14

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?

Napster_X
  • 3,333
  • 16
  • 20
blueFast
  • 4,000
  • 13
  • 36
  • 51

1 Answers1

20

Use -a option with rsync.

It will copy the broken symlinks too.

Something like this:

 # rsync -av source host:destination
Napster_X
  • 3,333
  • 16
  • 20
  • 19
    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 01 '17 at 13:30