BAD rsync, or is it bad me?
John Van Essen
vanes002 at umn.edu
Wed Dec 31 11:58:35 EST 2003
On Tue, 30 Dec 2003, Wesley Joyce <wjoyce at uvi.edu> wrote:
> Something very scary just happened to me while I was creating a ksh script
> to rsync mulitple FS between two hosts. Here is the script, notice the 'i'
> at the end of rsync line, it got put there by mistake. You also see the
> contents of $FSLIST cat'd below the script. When I ran this, it started to
> delete files in root's home directory and place files from the fist FS,
> /banner, into root's home directory. The resolved rsync line in the first
> instance would have been...
> rsync -vaz -e "ssh" --delete --exclude-from=/usr/local/adm/rsync.exclude
> /banner/ backenp650:/banneri
Nope. The destination in your script was "$DHOST:$FSi"
$FSi is a variable named FSi which does not exist, so a null
string was used, leaving your destination as "backenp650:"
And that would indeed be using the home directory on the destination.
Not bad rsync - bad you! ;-)
I would suggest always using --dry-run when debugging scripts like this
and then remove it when it looks like things will work as you intended.
John Van Essen Univ of MN Alumnus <vanes002 at umn.edu>
More information about the rsync