Is there an easy way to copy a directory recursively where symlinks to external files/directories are resolved (target file is copied), but internal symlinks (pointing to files inside the copied tree) are kept?
Example:
touch outsidefile
mkdir src
ln -s ../outsidefile src/sym1
touch src/insidefile
ln -s insidefile src/sym2
cp [???] src dest # or other command
wanted result:
$ ls dest
insidefile
sym1
sym2 -> insidefile
i.e. sym1
is a regular file, sym2
keeps to be a symlink.