Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


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

tar -x without clobbering directories



Greg Rundlett (freephile) wrote, On 05/05/2009 02:24 PM:
> On Tue, May 5, 2009 at 1:45 PM, Michael ODonnell
> <michael.odonnell-Wuw85uim5zDR7s880joybQ at public.gmane.org> wrote:
>>
>> My Debian system's tar identifies itself as "tar (GNU tar) 1.22" and
>> the output generated with --help includes the following excerpt where
>> that --no-overwrite-dir option sounds like what you wanted:
>>
>>  Overwrite control:
>>
>>  -k, --keep-old-files       don't replace existing files when extracting
>>      --keep-newer-files     don't replace existing files that are newer than
>>                             their archive copies
>>      --no-overwrite-dir     preserve metadata of existing directories
>>      --overwrite            overwrite existing files when extracting
>>      --overwrite-dir        overwrite metadata of existing directories when
>>                             extracting (default)
>>      --recursive-unlink     empty hierarchies prior to extracting directory
>>      --remove-files         remove files after adding them to the archive
>>  -U, --unlink-first         remove each file prior to extracting over it
>>  -W, --verify               attempt to verify the archive after writing it
>>
> 
> 
> Thanks.  There is a lot more option information in the --help output
> than in the man page.
> 
> I wanted to overwrite all directories except "sites" which is why I
> was hoping --exclude=sites would work.
> 
> I'll have to test  --keep-newer-files to see if that works.
> http://www.gnu.org/software/tar/manual/tar.html#SEC72
> 
> p.s. I read the tar man page (more than once), and those options
> aren't listed. There is this BUG statement at the bottom:
> 
> BUGS
>        The GNU folks, in general, abhor man pages, and create info
> documents instead.  Unfortunately, the info document describing tar is
> licensed under the GFDL with invariant cover texts, which violates the
> Debian  Free  Software Guidelines.  As a result, the info
> documentation for tar is not included in the Debian package.
> 
>        If you want to read the complete documentation for GNU tar,
> please refer to the online version at
> 
>                    <http://www.gnu.org/software/tar/manual/index.html>
> 
>        This  man  page  was created for the Debian distribution.  It
> does not describe all of the functionality of tar, and it is often out
> of date.  Patches to improve the coverage and/or accuracy of this man
> page are appreciated, and should be filed as wishlist severity bugs
> against the Debian tar package, not submitted to the GNU tar
> maintainers.
> 


Just curios, are you saying that when extracting Drupal everything under 
sites/ is wiped out?  For example any files created by you and not in 
the  Drupal tarball are gone after extraction?  That's the sense I got 
from your email but could not reproduce on Fedora 10 with tar 1.20. 
Also --overwrite-dir does not say it is the default behavior in the man 
page I have.

tom

-- 
| tmclaugh at sdf.lonestar.org                 tmclaugh at FreeBSD.org |
| FreeBSD                                       http://www.FreeBSD.org |







BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org