change of behaviour on rsync -R and top level symlinks?

Marc MERLIN marc at merlins.org
Tue Jun 15 19:58:36 MDT 2010


Here is what my data looks like:
source:~# ls -ld /data /data/etc2
lrwxrwxrwx 1 root     root 12 2010-06-03 23:32 /data -> /export/hda3
-rw-r--r-- 1 produser prod  4 2010-06-15 17:30 /data/etc2

destination:/# ls -l /data
lrwxrwxrwx 1 root root 12 2010-06-15 18:36 /data -> /export/hda3


Let's start with an ancient rsync:
source:~# rsync-broken --version
rsync version 2.4.6  protocol version 24
source:~# rsync-broken -rlpgoDH -R --delete -vv /data/etc2 destination:/
Client is very old version of rsync, upgrade recommended.
building file list ... done
delta-transmission enabled
data is uptodate
/data/etc2
total: matches=0  tag_hits=0  false_alarms=0 data=4
wrote 166 bytes  read 36 bytes  80.80 bytes/sec
total size is 16  speedup is 0.08

destination:/# ls -ld /data /data/etc2
lrwxrwxrwx 1 root     root 12 2010-06-15 18:36 /data -> /export/hda3
-rw-r--r-- 1 produser prod  4 2010-06-15 18:51 /data/etc2

All good. Now, I'll delete /data/etc2 on the destination and try again
with the new rsync client:

source:~# rsync --version
rsync  version 3.0.7  protocol version 30
source:~# rsync -rlpgoDH -R --delete -vv /data/etc2 destination:/
opening connection using: ssh -c none -P -o BatchMode=yes -o StrictHostKeyChecking=no destination rsync --server -vvlHogDprRe.isf --delete . / 
sending incremental file list
delta-transmission enabled
/data/
/data/etc2
total: matches=0  hash_hits=0  false_alarms=0 data=4

The /data symlink is clobbered and replaced by a directory. Very bad!
destination:/# ls -ld /data /data/etc2
drwxrwxrwt 2 root     root 4096 2010-06-15 18:53 /data
-rw-r--r-- 1 produser prod    4 2010-06-15 18:53 /data/etc2

Any idea what's going on here and is there a magic flag to work around this
problem?

Thanks,
Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  


More information about the rsync mailing list