|Manipulating *.tar.gz conents.|
Forums | Open Source OS
4/8/08 3:57:02 PM
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?
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.
EDIT: also tried:
tar --delete -vf blah.tar.gz out/
Which equals FAIL.
Edited by Johbremat: 4/8/2008 04:00:36 PM
4/8/08 4:52:50 PM
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
can you extract, rm then re compress? |
Ride a Bicycle!
6/8/08 3:08:33 PM
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*
6/8/08 7:19:27 PM
Is there a FUSE program for .tar.gz? That might have been an option. |
Edited by robzy: 6/8/2008 07:20:00 PM
עם ישראל חי
9/8/08 12:49:49 AM
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.