rsync replaces symlinks on destination

Matt McCutchen hashproduct+rsync at
Tue Sep 4 00:18:55 GMT 2007

On 9/3/07, aaa aaa aaa aaa <ai_chat_bot at> wrote:
> I need
> rsync to skip updating the destination file if it is a symlink that
> points to a file that is identical to the source file.

Rsync doesn't have an option to do that.  If the option existed, it
would be called --keep-links.  Using the current rsync, here are some
things you might try:

1. Exclude the offending symlinks.

2. Rearrange the destination so that only symlinks to directories are
used, and pass --keep-dirlinks.

3. Instead of following symlinks in the destination, create reverse
symlinks in the source and read through those symlinks using

4. If you care only about rsync not mangling destination symlinks
pointing to data *identical* to the source data, "diff -q" the source
and destination to get a list of paths at which the contents differ
and make rsync process only those paths using --files-from.

If you explain more concretely what you were hoping to accomplish by
having rsync follow symlinks in the destination, I might be able to
suggest a better approach.


More information about the rsync mailing list