I need to copy a directory tree full of symlinks to files on a different mount, but buried in the directory are 2 or 3 symlinks to directories outside the copy tree. I need to copy the symlinks pointing to files as actual files but keep the 2 or 3 symlinks to directories as symlinks.
scp -L
dereferences everything
I tried rsync -avHS
followed by rsync -avHS --keep-dirlinks
or rsync -avHS -K
but those preserve both file and directory links on the destination so you end up with nothing dereferenced.