bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] How to convert symbolic links pointing outside to a file?


From: Chuck Swiger
Subject: Re: [Bug-tar] How to convert symbolic links pointing outside to a file? (tar)
Date: Mon, 14 Jun 2010 09:39:11 -0700

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]