I am getting this message with rsync:

symlink has no referent: "/a/path"

Well, rsync is right: in the source filesystem, the (symbolic) link is pointing to a non-existent location. That is intended. The target of the link only exists in the destination filesystem. And I want rsync to ignore that fact and create the symlink in the destination.

How can I force rsync to do that?


Use -a option with rsync.

It will copy the broken symlinks too.

Something like this:

 # rsync -av source host:destination
  • 8
    I am using -L to create copies of files instead of copying symlinks. Like "rsync -a -L" If a symlink points to missing file, rsync would fail with "symlink has no referent" error. Is there a way to skip copying broken symlinks when -L option set? – SoichiH Dec 1 '17 at 13:30

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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