Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 5th January 2007, 03:25 AM
smkamene Offline
Registered User
 
Join Date: Aug 2004
Posts: 10
Append files with gzip

hello folks, i searched the forum/google but could not anything that could help me. I am trying to append a file to an already existing gzip files. The file is already a tar ball that has been gzipped and i need to append a few more files to it. I know i can append to tar ball but i wanted to see if there was a way to simpy append to the gzip file. Maybe other command line tools beside gzip can do that?

Thanks
Reply With Quote
  #2  
Old 5th January 2007, 03:33 AM
jim's Avatar
jim Offline
Retired Community Manager & Avid Drinker Of Suds
 
Join Date: Feb 2005
Location: Rochester NY
Age: 38
Posts: 4,176
appears tar has the ability to add files

tar <operation> [options]

Operations:
[-]A --catenate --concatenate
[-]c --create
[-]d --diff --compare
[-]r --append
[-]t --list
[-]u --update
[-]x --extract --get
--delete

Common Options:
-C, --directory DIR
-f, --file F
-j, --bzip2
-p, --preserve-permissions
-v, --verbose
-z, --gzip
__________________
Registered Linux User: #376813
Western NY
My linux site
Smolt Profile

please remember to say if you problem was solved

Did you get your id10t award today?
Reply With Quote
  #3  
Old 5th January 2007, 04:12 AM
RupertPupkin's Avatar
RupertPupkin Offline
Registered User
 
Join Date: Nov 2006
Location: Detroit
Posts: 4,616
Use bash to roll your own:
Code:
#!/bin/bash
TARBALL="$1"
FILETOADD="$2"
gunzip "${TARBALL}"
tar --append --file="${TARBALL%.gz}" "${FILETOADD}"
gzip "${TARBALL%.gz}"
Save the above script in a text file called, say, add2tarball, then do "chmod 755 add2tarball" and put the script somewhere in your PATH.
Run it like this: add2tarball some_tarball .tar.gz some_file_to_add
In other words, the 1st argument to the script is the name of the tarball, the 2nd argument is the file to add.

Obviously the script could be improved (e.g. trapping errors). Also, it would be easy to add a for loop to handle adding more than one file. That would be a good bash exercise.
Reply With Quote
  #4  
Old 5th January 2007, 01:02 PM
smkamene Offline
Registered User
 
Join Date: Aug 2004
Posts: 10
yeah, so i guess native gzip does not have an option to append to existing gzip files.
Reply With Quote
Reply

Tags
append, files, gzip

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Profile kernel append??? mcmackin Using Fedora 0 21st January 2009 05:05 AM
append two jpeg images S N RAY Fedora Focus 18 18th October 2008 11:08 PM
Can I append a ks= within isolinux.cfg? zoomtard Installation and Live Media 1 5th October 2005 09:08 PM
Is it possible to append session to FC4 dvd? Belegdol EOL (End Of Life) Versions 4 15th June 2005 08:01 AM
.zip files and gzip bsoderror Using Fedora 5 20th July 2004 02:58 AM


Current GMT-time: 06:23 (Monday, 20-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat