Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using rsync to synchronize files between a source area and a target area, where the target directory hierarchy contains symbolic links.

When a source directory has the same name and relative path as a symbolic link in the target area, then rsync replaces the symbolic link with the copied source directory and all its contents. I want rsync to instead leave the symbolic link intact, and only copy files that would have been copied had the symbolic link been a real directory.

I'm currently using -Cvrtp options to rsync. I'm aware of the --links option, but that appears to relate only to symbolic links in the source area.

Is there a way to obtain the behavour I'm looking for with rsync?

share|improve this question
add comment

1 Answer 1

No sooner had I asked the question, then I discovered the answer:

The -K / --keep-dirlinks rsync option would appear to be exactly what I'm looking for.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.