remote starting dir failsafe ?

Juri Mianovich juri_mian at yahoo.com
Fri Feb 29 22:14:20 GMT 2008


Hello,

I am going to be running an:

rsync -av --delete $source user at host:$destination

from one system to another.

The problem is, $destination is a variable given by a
script, and over time, many such rsync commands with
many such variables will be run.

I lay awake at night wondering what would happen if
someone plugged in a broken $destination, and my
nightly rsync proceeded to delete everything on the
destination ...

For instance, what if the destination is normally:

/home/users/joe

and someone has an extra (space) character, or
otherwise screws up the entry, and one night we run
with a destination of:

/

all of joe would get backed up, but everything else
would be --delete'd.

So my question is, is there any mechanism in the rsync
arguments that lets me explicitly tell it "don't start
below /home/users"

So no matter what the destination variable ends up
being (broken or not) the damage is restricted to
things inside of /home/users, and _no matter what_
there is no possibility of --delete'ing anything below
that ?

Comments ?

I have considered running a jail on the destination
and backing up to the jails IP instead of the actual
servers IP, but that seems unnecessarily complex.  I
am hoping this can be done with normal rsync
arguments...

Thanks!


      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping



More information about the rsync mailing list