It isn't a direct answer to your question.. But, have you considered
using bind mounts instead of symlinks for these directories?
On 2026-11-09 16:06, David Niklas via rsync wrote:
Hello,
I'm using rsync 3.5.XX to sync info between two computers. One PC has a
large enough disk to store all the info directly on it. The other uses
multiple drives to store the information.
To solve the problem of having multiple directories on the the second
system being laid out differently than the first, I used symlinks to
reconstruct the filesystem of the first.
The problem is when I try to sync system two with system one the symlinks
mentioned the cmdline end up being copied over as symlinks, instead of as
directories.
I tried to solve this by using rsync -ak but then *every* symlink is
deferenced, not just those mentioned on the cmdline. I'd do:
"rsync -a /dir1/ /dir2/ user@host:/destination/"
but then the contents of the directories are copied to /destination/ where
I need the directories and their contents copied.
I'm kinda lost on which cmdline switch I should be using for this as
rsync's behavior is fairly unique regarding trailing slashes in this
regard and I'd rather not experiment if I could help it. It was already a
pain to clean-up after using -k and discovering that an infinite
recursion path to / was deferenced!
How would I copy symlink dirs as dirs that are mentioned on the cmdline?
Thanks!
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html