Can tar add files to .tar.gz archives ?

Can tar add files to .tar.gz archives ?

Post by javibarr.. » Sat, 14 Jan 2006 21:55:12



The command
tar rzf archive.tar.gz file
returns "abort"

If I don't want to ungzip the archive, I can't add files to it, isn't?

Thanks !

 
 
 

Can tar add files to .tar.gz archives ?

Post by Etienne Marai » Sat, 14 Jan 2006 22:34:48



> The command
> tar rzf archive.tar.gz file
> returns "abort"

> If I don't want to ungzip the archive, I can't add files to it, isn't?

> Thanks !

My tar attempt is more explicit about this:

tar -rvzf ar.tgz d
tar: Cannot update compressed archives
tar: Error is not recoverable: exiting now

Neither can you compress a non gz'ed
tar archive file while appending

tar -rvzf ar.tar d
tar: Cannot update compressed archives
tar: Error is not recoverable: exiting now

:(

Now let's hope somebody posts a nice
one-liner.

--
Etienne Marais
Cosmic Link
South Africa

 
 
 

Can tar add files to .tar.gz archives ?

Post by Etienne Marai » Sun, 15 Jan 2006 00:07:53


Quote:> Now let's hope somebody posts a nice
> one-liner.

In the meantime here is my attempt:

tar -czf newfile.tgz newfile && tar -Af original_tar_gz.tgz newfile.tgz

So you never get to decompress your original archive...

--
Etienne Marais
Cosmic Link
South Africa