Keeping individual dirlinks

Matt McCutchen matt at
Sun Nov 4 20:57:11 GMT 2007

It would be nice if rsync offered a way to specify individual dirlinks
to keep without keeping all dirlinks.  (Unison can do this.)  For
example, consider the following command:

rsync -a --relative src/./ dest/

If rsync refrained from trimming a trailing /. off of source arguments
(at least as an option), one could keep a dirlink by passing it as an
additional source argument with a /. and excluding the non-/. version so
that rsync does not see the symlink to convert it to a directory:

rsync -a --relative --exclude='/mydirlink' src/./ src/./mydirlink/.

AFAICT, this wouldn't worsen daemon security because any destination
symlink a crafty client could follow using the /. syntax he could
already follow by passing a destination path that goes through it.


More information about the rsync mailing list