How do you add files to an existing compressed tar file?

Michael Vanecek mike at mjv.com
Fri May 5 15:03:16 MST 2006


I *thought* there was a way to do it directly - but even the Gnome 
Archive Manager decompresses an archive, adds the file, the recompresses 
it. I do similar in a way - I have a backup directory that I compress 
into a file periodically, overwriting the previous tar.gz.

Cheers,
Mike
--
http://www.taroandti.com/ Exotic Plants and More...
http://www.mjv.com/ Home...


Erik Bixby wrote:
> I can successfully create a tar file with something akin to
> 
> tar -czvf /path/to/archive.tgz /path/to/file/to/backup
> 
> Once the archive.tgz file is created, how does one add another file to
> it?  Everything I've read gives me the impression that
> 
> tar -rzvf /path/to/archive.tgz /path/to/other/file/to/backup
> 
> should work.  However, that's blowing my archive.tgz file up.  Any ideas?
> 
> What I'm trying to do is write a script to create archive.tgz if it
> doesn't exist (works), and add a file to it, if it does already exist
> (currently blows up my archive).
> -Erik


More information about the PLUG-discuss mailing list