Shell Script Does not complete if rsync returns Code 24
John Gallagher
john.gallagher at ciosystems.com
Wed Jan 11 16:39:57 GMT 2006
> If you want to handle errors from rsync in your shell script,
> then remove the "-e" and test for errors after your call to rsync.
>
> Linus
Let me start by saying my shell scripting skills are very weak, as if that
were not already apparent.
I understand the -e will exit when the return code is other than 0. I
believe this is what I want with the exception of the rsync code 24 files
have vanished error. The script is a modified version of one of the
examples found on http://www.mikerubel.org/computers/rsync_snapshots/. It
takes almost 3 hours to complete the index of the directory, sync and then
removal of the oldest backup (Snapshot).
Are you saying that in order to use the wrapper example below I need to
remove the -e? How do I call the wrapper or do I need to incorporate this
example into the original script? This is where I am clueless.....
From: http://samba.anu.edu.au/rsync/FAQ.html
The easiest way to do this is to create a shell script wrapper. For
instance, name this something like "rsync-no24":
#!/bin/sh
rsync "$@"
e=$?
if test $e = 24; then
exit 0
fi
exit $e
Thanks,
John
More information about the rsync
mailing list