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. Matt
On Sun, Nov 04, 2007 at 03:57:11PM -0500, Matt McCutchen wrote:> 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:That already works just by specifying a relative source path with a trailing slash. Since rsync always sends implied dirs as dirs now, any symlink that is discovered during the directory scan is discarded as a duplicate: mkdir src realdir touch src/file1 realdir/file2 ln -s ../realdir src/sym rsync -avRii src/./ src/./sym/ dest/ ..wayne..
Possibly Parallel Threads
- --keep-dirlinks --delete erroneously deletes symlinks to directories
- Using --keep-dirlinks : recursive symlinks problem
- error on --copy-dirlinks shortform in manpage
- rsync 3.0.6 and keep-dirlinks in daemon mode
- difference between --no-implied-dir abd --keep-dirlinks ?