From ae03e0e008006c5be045c478327c860625daab0e Mon Sep 17 00:00:00 2001 From: Matt McCutchen Date: Sun, 4 Oct 2009 01:24:50 -0400 Subject: [PATCH] Document the "copy-some-dirlinks" trick in the man page. Originally explained at: http://lists.samba.org/archive/rsync/2006-February/014838.html --- rsync.yo | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rsync.yo b/rsync.yo index 20162727..ebc61f37 100644 --- a/rsync.yo +++ b/rsync.yo @@ -881,6 +881,17 @@ bf(--force) or bf(--delete) is in effect). See also bf(--keep-dirlinks) for an analogous option for the receiving side. +bf(--copy-dirlinks) applies to all symlinks to directories in the source. If +you want to follow only a few specified symlinks, a trick you can use is to +pass them as additional source args with a trailing slash, using bf(--relative) +to make the paths match up right. For example: + +quote(tt(rsync -r --relative src/./ src/./follow-me/ dest/)) + +This works because rsync calls bf(lstat)(2) on the source arg as given, and the +trailing slash makes bf(lstat)(2) follow the symlink, giving rise to a directory +in the file-list which overrides the symlink found during the scan of "src/./". + dit(bf(-K, --keep-dirlinks)) This option causes the receiving side to treat a symlink to a directory as though it were a real directory, but only if it matches a real directory from the sender. Without this option, the -- 2.34.1