Difference in behaviour with --backup

va_public <yahoogroups at vikas.mailshell.com> yahoogroups at vikas.mailshell.com
Tue Feb 25 08:59:07 EST 2003

When I do

rsync -av --backup --backup-dir=/dir1/dir2/Backup \
 /dir1/dir2/dir3 machine:/dir1/dir2/dir3

I get /dir1/dir2/Backup/dir3/...

i.e. the tree under 'dir3' (my source tree) gets created 
under .../Backup. This is fine.

But when I do the same thing with a single file like

rsync -av --backup --backup-dir=/dir1/dir2/Backup \
   /dir1/dir2/file machine:/dir1/dir2/file

I see that I get


instead of


In the latter case, why is the entire tree (from root) recreated in 
the backup-dir instead of the simply the last component like in the 
former case?

Am I making sense? I hope so.

Why the inconsistency? Any way around it?


More information about the rsync mailing list