The Samba-Bugzilla – Bug 7953
-x flag prevents symlink on source filesystem from overwriting dest dir
Last modified: 2011-04-04 16:58:29 UTC
rsync will not recursively delete a directory on the destination file system when the -x flag is used and the source is a symlink on a different file system.
This is inconsistent with the behaviour seen when rsync'ing between directories in the same context.
Commands to reproduce:
mount -t tmpfs -o size=1M,nr_inodes=1000,mode=0700 tmpfs /testing
ln -s /testing/bar /testing/foo
mkdir --parents /tmp/foo/bar/baz
rsync -arvx --delete --force /testing/foo /tmp
sending incremental file list
cannot delete non-empty directory: foo
could not make way for new symlink: foo
sent 41 bytes received 12 bytes 106.00 bytes/sec
total size is 12 speedup is 0.23
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1060) [sender=3.0.7]
I've just checked in a fix for this. The device number of the destination wasn't being stored w/o --delete, so the removal would fail the same-device check.
*** Bug 8057 has been marked as a duplicate of this bug. ***