Hi-- On Jun 14, 2010, at 7:09 AM, Peng Yu wrote: > I only want to convert symbolic links that point outside the directory > to be archived to a file. But I still want to keep symbolic links > point inside as symbolic links. Is there an option or a walkaround to > do so in tar?
The -h/--dereference option comes close, but what you really want is rsync's --copy-unsafe-links option. Use rsync with that flag to make a copy of the tree you wish to tar up; rsync will chase and create local copies of symlinks which point outside of the tree, but leave the symlinks which are internal alone. Then run tar to archive that copy.... Regards, -- -Chuck
