add files to compressed tar-archive
-
mister_v
- Posts: 203
- Joined: Thu Mar 04, 2010 9:19 pm
add files to compressed tar-archive
Does anyone know how to add files to an existing compressed tar-file?
-
chris
- Site Admin
- Posts: 216
- Joined: Mon Jul 21, 2008 9:52 am
Re: add files to compressed tar-archive
Short answer you can't:
You can however update/add files to normal tar-files.
So there are 2 options.
you can extract everything from the compressed tar-file
and then re-add everything, including the new file.
Or, and perhaps better.
first compress the file and then add to the tar-archive.
Code: Select all
tar: Cannot update compressed archivesCode: Select all
tar -uvf file.tar addfile.pdfyou can extract everything from the compressed tar-file
and then re-add everything, including the new file.
Or, and perhaps better.
first compress the file and then add to the tar-archive.
Code: Select all
gzip -c $FILE > $COMPRESSED.gz;
tar -uvf $NEWARCHIVE $COMPRESSED.gz;-
mister_v
- Posts: 203
- Joined: Thu Mar 04, 2010 9:19 pm
Re: add files to compressed tar-archive
Not really what I was looking for,
but it works.
So thanks
but it works.
So thanks