Re: Bash script questions.
- From: birre <spamtrap@xxxxxxxxxxxx>
- Date: Wed, 28 Mar 2007 14:59:21 +0200
On 2007-03-27 07:44, Longfellow wrote:
I've got rsync backing the partitions of one drive to another, and they
all work find. Now I want a shell script to run all the backups.
I began with mount checks:
if [ ! -d {some directory in backup partition} ]; then
mount -t ext2 {backup partition} /mnt/{backup mount}
fi
for each backup partition.
Then I list all the backup scripts with sleep 60 between each to let
things cool down a bit.
1) In each backup script: I've yet to trust the backup log to record
any error messages because I don't know whether or not '2>&1' works with
'>>' (append). I gather that the '2>&1' should be at the end of the
command rather than following or preceeding the append operator. Does
this work with append, and if so, where should it be?
2) In the master script, I want each backup script to be able to write
any problems to the log file. I gather that rsync gracefully exits with
an error message in any case, but I'm not certain. I don't want each
script to depend on the success of the previous one, so I'm not using
'&&' between scripts. What, if anything, should follow the script
executable?
If all this gets to work dependably, it will become a cron job, so I
won't be around to intervene if things screw up.
Thanks
Longfellow
I maybe don't understand your question, but whatever you do in the end,
do NOT use multiple scripts using the same log, it can be out of order
due to buffering..
use a main script, and from there
(
variables and stuff
script 1
script 2
more stuff
) >> log
/birre
.
- References:
- Bash script questions.
- From: Longfellow
- Bash script questions.
- Prev by Date: Re: FREE Linux Shell Provider
- Next by Date: Re: FREE Linux Shell Provider
- Previous by thread: Re: Bash script questions.
- Next by thread: How do I configure a sound card?
- Index(es):
Relevant Pages
|