Home
Friday, April 28, 2017
8:43:29 AM
Users online: 0   You are here >> Home > Open Source OS

Forums | Open Source OS Forums search
Forum FAQ
   
  1  
Manipulating *.tar.gz conents.
Johbremat 
4/8/08 3:57:02 PM
Master
Production server had contents tarred and zipped (4GB to about 800MB).

Want to drop into the test environment, but don't have enough space.

Is anyone aware of a way to delete some of the contents of a *.tar.gz?

Tried:

tar --delete --file=blah.tar.gz path/*.pdf

but no go:

tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: Read 7716 bytes from blah.tar.gz
tar: out/*.pdf: Not found in archive
tar: Error exit delayed from previous errors

Tried other permutations of the path, but to no avail.

Suggestions?



EDIT: also tried:

tar --delete -vf blah.tar.gz out/

Which equals FAIL.








Edited by Johbremat: 4/8/2008 04:00:36 PM

-----

[playerone] 
4/8/08 4:52:50 PM
Overlord

jba@exothermic:~/data% tar -vz --delete --wildcards -f testing.tar.gz "*/audio"
tar: Cannot update compressed archives
Try `tar --help' or `tar --usage' for more information.

Thats how you would do it but you cant.

Alternatively why not exclude files when extracting the archive?

--exclude=PATTERN exclude files, given as a PATTERN

-----
Quia Stercus Accido

Bob Hawke 
4/8/08 5:50:49 PM
Guru

can you extract, rm then re compress?

-----
Ride a Bicycle!

Johbremat 
6/8/08 3:08:33 PM
Master
Bah. I dropped into Windows and used 7-zip to remove the unnecessary.

Didn't realise you could exclude on extraction.

*files away for future reference*

-----

robzy 
6/8/08 7:19:27 PM
Hero
Immortal


Is there a FUSE program for .tar.gz? That might have been an option.

[edit]: http://www.linux.com/feature/132196

Rob.


Edited by robzy: 6/8/2008 07:20:00 PM

-----
עם ישראל חי

TheSecret 
9/8/08 12:49:49 AM
Primarch
My guess is since it is a Tar GZIP archive, and you are just treating it as a tar archive, it is not understanding it properly. Next time try running it through gzip with the -z option.

-----
Part of the inhumanity of the computer is that, once it is competently programmed and working smoothly, it is completely honest.

  1  
Forums | Open Source OS