--copy-unsafe-links unexpected behavior with unsafe symlinks

Wayne Davison wayne at opencoder.net
Fri Dec 31 20:39:16 UTC 2021

On Sun, Nov 28, 2021 at 12:53 PM Cristian via rsync <rsync at lists.samba.org>

> $ rsync --copy-unsafe-links -avz --delete tree XXX

In this case, the "tree" directory is a part of the transfer inside the
top-of-transfer dir (the current directory). Thus any symlinks that don't
try to escape the current directory are considered to be OK.  You should
instead suffix "tree" with a slash and add "tree" to your destination path:

$ rsync --copy-unsafe-links -aivz --delete tree/ host:/old/path/tree/

This is discussed in the man page
<https://download.samba.org/pub/rsync/rsync.1> (search for "unsafe").

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20211231/9ed7078b/attachment.htm>

More information about the rsync mailing list