The Samba-Bugzilla – Bug 4531
symlinks updating doesn't work properly during updates
Last modified: 2007-07-17 06:31:15 UTC
rsync -vrlKtpz --update --stats --progress -e ssh src/ dst/
I am updating files on destination, keeping the ones on dst/ that are more recent.
Both under src and dst there is a symlink, however the one in dst has changed its target and has a more recent date. For me the latter is newer than the old one in src/
When I execute the command above the symlink in dst/ is reset to the old target It still has in src/.
One more thing that may be useful: system on src/ side is a Mandriva 06 with Linux 2.6.14 and ext3 and rsync 2.6.6. System on dst/ is Mac OS X 10.4 with HFS and rsync 2.6.3.
Created attachment 2451
Symlinks are not affected by the --update option. This option just affects file transfers.
One reason for this is that many systems cannot preserve the modification time of a symlink, so a copy of an old symlink can have a newer timestamp than a symlink that was created more recently (e.g. if more than 2 systems are involved in the coping process).
For multi-direction synchronization, I recommend using a tool designed for that purpose, such as unison.
(In reply to comment #3)
> Symlinks are not affected by the --update option. This option just affects
> file transfers.
I understand the implementation problems that has lead to adopt such a behavior. However I think this is misleading and dangerous. I've lost some links this way and I needed to review a server configuration at hand. At least a warning message, such as "ignoring symlink date, considering the target date" would be good.