rsync and symlinks

Carlos Carvalho carlos at fisica.ufpr.br
Tue Sep 1 12:57:15 MDT 2009


Jignesh Shah (jignesh.shah1980 at gmail.com) wrote on 1 September 2009 22:17:
 >Thanks Carlos.
 >
 >... rsync copy symlinks as  symlinks
 >What about the contents pointed by simlinks?

If they exist on the destination at the same place the symlink will
point to them, otherwise they'll dangling there (at the destination).

 >Could you please also elaborate on "Only if it's inside source."

In you diagram below

 >>  >source
 >>  >   |
 >>  >   | - source1 --> /projects/win
 >>  >   | - source2 --> /projects/unix
 >>  >   | - source3 --> /scripts/win

If projects is inside source it'll be copied. However you said it's
outside, and your absolute paths above also indicate it, so projects
will not be copied and the symlinks at the destination will be
dangling.

rsync has several options to deal with symlinks; there's a section of
the manual just for this. If you want to have the contents pointed to
by the symlinks copied to the destination you might want to look at
these options.


More information about the rsync mailing list