rsync copy syntax error?

satadru pramanik satadru at umich.edu
Thu Oct 28 01:35:59 GMT 2004


I'm doing a recurring copy from one server to another from the crontab 
in this fashion:

rsync -av -e ssh --delete 10.0.1.18:/dir1/ /dir1 --progress &> 
/var/log/rsync_backup.log

However, rsync is creating the dir /dir1/dir1 on the machine running 
this job instead of updating the /dir1 folder.


According to the rsync man page, this is the correct syntax:

  rsync -avz foo:src/bar/ /data/tmp


A trailing slash on the source changes this behavior to avoid creating 
an additional directory level at the destination.  You can think of a 
trailing / on a source as meaning “copy the contents of this directory” 
as opposed to “copy the directory by name”, but in both cases the 
attributes of the containing  directory  are transferred to the 
containing directory on the destination.  In other words, each of the 
following commands copies the files in the same way, including their 
setting of the attributes of /dest/foo:

               rsync -av /src/foo /dest
               rsync -av /src/foo/ /dest/foo



Am I doing something wrong?  I am using rsync  version 2.6.3  protocol 
version 28 on a Debian/Sarge system.

Regards,

Satadru


More information about the rsync mailing list