rsync deleting symbolic link unexpectedly

John Van Essen vanes002 at
Tue Dec 20 22:58:50 GMT 2005


--keep-dirlnks was added in version 2.6.3, so it's available in 2.6.6
(but both ends have to be 2.6.3 or later).

Here's an online version of the current man page:

--keep-dirlinks (-K) is definitely what you need...


On Tue, 20 Dec 2005, Eric Horne <eric.horne at> wrote:
> Thanks, Matt for this suggestion. My version (2.6.6) doesn't have a
> keep-dirlinks option (that sounds like what I want, though).
> In anycase, I removed the -L, and now the structure does not get created
> at all. I removed -l also, and that didn't work either. I added only the
> -L back, and was left with the same behaviour -- that the symlink turns
> into a directory.
> So I think I'm still stuck (or I misunderstood what you said)
> -Eric
> Matt McCutchen wrote:
>> On Tue, 2005-12-20 at 11:40 -0800, Eric Horne wrote:
>>>rsync -rlptDvzL --stats --include=a/ --include=a/dir/
>>>--include=a/dir/symlink/ --include=a/dir/symlink/dir2/
>>>--include=a/dir/symlink/dir2/dir3/ --exclude='**' /export/stuff
>> Since you gave the -L/--copy-links option, the sending rsync pretended
>> its symlink was a real directory, and since you didn't give
>> -K/--keep-dirlinks, the receiving rsync turned its symlink into a real
>> directory to match.  -L overrides -l.  Take out -L and it should work.
> --
> To unsubscribe or change options:
> Before posting, read:

More information about the rsync mailing list