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

Darrin Chandler dwchandler at stilyagin.com
Fri May 5 14:43:03 MST 2006


On Fri, May 05, 2006 at 02:20:29PM -0700, 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?

I don't have time to reboot into Linux right now, but on OpenBSD it
complains bitterly that it can't gzip while appending, and refuses to do
anything.

Leaving off the "z" option and working with straight .tar files works
great.

If that's the case for the tar you're using then you'll have to
decompress, append, then recompress.

-- 
Darrin Chandler            |  Phoenix BSD Users Group
dwchandler at stilyagin.com   |  http://bsd.phoenix.az.us/
http://www.stilyagin.com/  |


More information about the PLUG-discuss mailing list