in the first set of changes suggested in message sequence #8 in this thread to:
Code:
comp=${1:-$(date "+Completed.%Y%m%d")}
Then it will behave exactly as it did before if you invoke your backup shell script with no arguments. I don't know the name of your script, but for this discussion, suppose that it is called backupdbs. If you issued the command:
Code:
backupdbs
late last night, it would have created Completed.20120926 as the list of successfully completed backups. If you looked at the log files this morning and found that one or more backups failed, you could use the command:
Code:
backupdbs Completed.20120926
to use the list created last night instead of creating a new file for today (Completed.20120927).
In case someone is reading this doesn't understand the command:
Code:
comp=${1:-$(date "+Completed.%Y%m%d")}
It sets the the variable comp to $1 (the 1st argument to yoiur shell script) if that argument is set and is not an empty string; otherwise, it expands $(date "+Completed.%Y%m%d") and sets comp to that value (i.e., Completed.YYYYMMDD where YYYY is the current year, MM is the current two-digit month, and DD is the current two-digit day within the current month).
If you don't like my proposed naming convention for the list of successfully completed backups, change $(date "+Completed.%Y%m%d") to whatever you want. Or just make up a new name every day and always invoke your shell script with that name as its operand. (Just be sure that the name you choose doesn't contain any whitespace characters nor any characters that would be treated specially by your shell such as *, ?, $, etc.)
This User Gave Thanks to Don Cragun For This Post:
Hi folks.
I'm just starting to teach myself shell scripting and am having some trouble with an if statement. I am working with a directory where only one file will reside at a time and need to evaluate if this file is compressed to determine subsequent steps. I'm using echo for testing purposes.... (2 Replies)
Hi,
I found this strange behaviour while using one of the makefiles.
Here is the snippet of the unix.mak that is necessary for this context
SO = SvSocket.o SvStmt.o SvOdbcWrapper.o \
OdbcCallReader.o MgrCalls.o OdbcSvProxy.o \
OdbcSvApp.o... (4 Replies)
Hey all. I am trying to find a process that is running and appending it to a file. The comman I am using is
ps -eaf |grep tctl.
The problem is, it returns the tctl process as well as the grep process that I just ran. Is there a flag that will prevent the command from returning itself?
... (2 Replies)
hello everybody and a happy new year!
i am trying the client-server model...i have no problem with sockets etc...
especially for server:there is a father who is listening for TCP connections from clients,the later send commands which parent shares to his children.
then children execute... (1 Reply)
I have a script which will look for a test folder under the parent directory. If the folder contains test folder then create the same directory structure in other remote machine.
Once the directories are created then transfer all the contents of that test folder.
this is what i am doing :-
... (2 Replies)
I'm running an arp -an on a Solaris 10 box. We're using IPMP. One of the systems is not able to see a host on the same network. The only difference between the two systems (one is having a problem, the other isn't) at least so far is the output of arp:
# arp -an | grep 224.55
e1000g5... (1 Reply)
Hi,
I have two different scripts sap_ftp.sh and sap_ftp_dd.sh which are running continously in background. I am using another script called start.sh to launch these two scripts.
Either one script will process files at a time . During that time other script will sleep.. Each script will... (1 Reply)
Hi there,
I need your help in understanding the below Solaris 10 ifconfig output;
athnetspns02>ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g0:... (2 Replies)