copy symbolic links as real file during syncing files.

John Van Essen vanes002 at
Mon Nov 13 06:57:40 GMT 2006

On Mon, 13 Nov 2006, <wangpenghui at> wrote:
> I want to sync one big directory from one host to a remote host.
> And there are several symbolic links which linked to some files
> and directories that outside the certain directory. I want to
> copy the symbolic links as real file or directory.

The rsync man page describes this option:

-L, --copy-links
    When symlinks are encountered, the item that they point to  (the
    referent) is copied, rather than the symlink.  In older versions
    of rsync, this option also had the side-effect  of  telling  the
    receiving  side to follow symlinks, such as symlinks to directo-
    ries.  In a modern rsync such as this one, you'll need to  spec-
    ify  --keep-dirlinks  (-K) to get this extra behavior.  The only
    exception is when sending files to an rsync that is too  old  to
    understand -K -- in that case, the -L option will still have the
    side-effect of -K on that older receiving rsync.

If you are using rsync as a daemon, then be aware that if any of the
symlink targets are outside of the module's path, you must declare
"use chroot = no" for that module.


More information about the rsync mailing list