Re: Bash script questions.



Longfellow <not@xxxxxxxxxxxx> writes:

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?

You want first to attach 1 to its output, and then 2 to 1.
command >>/tmp/junk 2>&1


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?

script >>/where/you/stuck/the/log/file 2>&1

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

.



Relevant Pages

  • Re: What is the need for @ symbol in php script
    ... The '@' just suppresses error messages, which is never a good idea ... A fatal error will ALWAYS stop your script from working - that's why ... Hardly cumbersome, compared to managing code with list, and ... extractfunction makes the process easier. ...
    (comp.lang.php)
  • Re: IE Wont Open
    ... notification about every script error." ... Open Internet Explorer. ... Two download versions are available for Windows Script 5.6. ... please post back to this thread with the details and any error messages. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: IE Crashes when loading page with javascript
    ... See these articles for possible help w/ error messages in scripting: ... Error Message When You Browse the Web: An Error Has Occurred in the Script ... Windows Script 5.7 for Windows XP ... updates/security roll-ups, etc. from Windows Update. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: IE Crashes when loading page with javascript
    ... See these articles for possible help w/ error messages in scripting: ... Error Message When You Browse the Web: An Error Has Occurred in the Script ... Windows Script 5.7 for Windows XP ... updates/security roll-ups, etc. from Windows Update. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Logon Scripts for Dept. and Printers based on Groups and IP
    ... I have a script that was put together by a several different scripts ... error messages and report them to me so I can fix them. ... Our logon script logs its proceedings and error messages into a file in the ... Having some drives pre-assigned is therefore not ...
    (microsoft.public.scripting.vbscript)