parsed.org
SCP Symlinks by xinu on Dec 19, 2005 12:05 PM

If you're running scp -r, beware of symlinks; they are followed rather than preserved. This might be favorable behavior if you're referencing files outside what you're copying, but if you're copying symlinks which reference other parts of what you're copying, the referenced files will be duplicated on the destination host.

Take, for example, the following files on host A:

~/myfiles/
  foo/
    a.txt
  bar/ -> foo/

When you run this command on host B:

joe@B:~$ scp -r joe@A:~/myfiles .

The result on host B will be:

~/myfiles/
  foo/
    a.txt
  bar/
    a.txt
commandsgotcharecursivescpshellsymlinks
RSS