symlink in -R src_dirlist and real dirs on target

Kevin Korb kmk at
Mon Dec 2 12:27:17 MST 2013

Hash: SHA1

Drop the --copy-dirlinks and add a trailing / to your sources:
rsync -RaH --stats --delete --progress --itemize-changes dir1/ dir2/

itemize-changes is always nice too ;)

On 12/02/13 14:21, - wrote:
> 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 dir2
> 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 hapens:
> src1/usr/bin/X11 -> . becomes 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 mounts
> 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.
> Thanks
> lopiuh

- -- 
	Kevin Korb			Phone:    (407) 252-6853
	Systems Administrator		Internet:
	FutureQuest, Inc.		Kevin at  (work)
	Orlando, Florida		kmk at (personal)
	Web page:
	PGP public key available on web site.
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -


More information about the rsync mailing list