bad behaviour of "dry run" -n option

Wayne Davison wayned at
Sun Apr 25 18:00:41 GMT 2004

On Sat, Apr 24, 2004 at 12:22:57PM +0400, Denis Lagno wrote:
> I see strange behaviour in presence of symlink.

Facinating case there!  The copy you cited is really going to delete the
symlink in the destination and recopy the whole dir, so it does not list
deletions within the X11 dir.  What is apparently happening is that
rsync fails to mention that it needs to delete the X11 symlink in the
destination, and then (because -n was specified and the deletion didn't
actually occur) it tries to tell you everything that it would copy, but
the list is abbreviated due to the fact that the symlinked-to directory
is a nearly exact copy of what would be sent.

You can change your command from this:

    rsync -anc --delete X11 /etc

to this:

    rsync -anc --delete X11/ /etc/X11

to avoid both the /etc/X11 symlink being replaced with the X11 dir, and
to get an output that includes the list of deletions that would happen.

I'll check into why the symlink's (planned) deletion isn't being
mentioned in the former command.


More information about the rsync mailing list