Backup and renaming old file that became directory

Yan Morin yan.morin at
Tue Jul 11 15:35:37 GMT 2006


 i've got a problem with rsync right now and I use the command:
rsync -abqz --delete --backup-dir /mnt/backup/foo/old /home /mnt/backup/foo

The problem is that in /mnt/backup/foo there is a old file with the name 
"bar" (by example).
In /home and /mnt/backup/foo/old, I have a directory with the name "bar".
So i have
/mnt/backup/foo/home/bar  <-- file
/mnt/backup/foo/old/home/bar  <-- directory
/home/bar <-- directory

Since 2.6.7, rsync don't send warning in dry run when this case occurs, 
but in running mode, the rsync fail.
Should I delete the file /mnt/backup/foo/home/bar manually or is there 
an option to rename it /mnt/backup/foo/bar~ by example.

Yan Morin
yan.morin at

More information about the rsync mailing list