symlink in -R src_dirlist and real dirs on target

- lopiuh at
Mon Dec 2 12:21:45 MST 2013

Hi folks,

I have a bunch of directories to mirror via rsync. I have lots of
hardlinked files spread about these directories. Therfore I use -R
(--relative) and -H.

so far ok but:

I create symlinks to the source-directories via script because src-dirs
have changing names (date and time of backup) and I want to have constant
directory names on target. How can I achieve that?

I thought -k (--copy-dirlinks) would work but this replaces ALL symlinks to
dirs which exist in the copied tree to real directories. I just want to
have the "symlink dir conversion" done on the starting directories dir1 and

cd /tmp/backup
rsync -RaH --copy-dirlinks --stats --delete --progress  dir1   dir2   dest/

dir1 and dir2 are symlinks to directories which contents have to be mirrored
I want to have real directories dest/dir1 and dest/dir2 after rsyncing and
not only the symlink copied. Using  -k (--copy-dirlinks) the following

src1/usr/bin/X11 -> .
dest/src1/X11/X11/X11 (and so on) because the symlink to "." gets a copy of
the contents of the directory src1/usr/bin/

I could do bind mounts for src1 and src2 but normaly I try to avoid bind

How do I mirror the contents of name name changing directories when I want
to use fixed directorynames at destination. My symlink to dir approach was
not successfull.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the rsync mailing list