Is there any way to add to a tarball made in this fashion
Hello,
I am wondering if there is an easy way to add a file to a tarball rather than extracting, adding, then remaking the tarball.
The tarball was made in this way:
If I had a file to the .wine/ dir (or if I just wanted to add a file to the tarball), I would like to add it to .wine.tar.gz rather than having to un(tar/gzip) it, add it to the dir, and then re-tarball it (yes I know I could just add it to .wine/ then redo the above command; I'm just looking to understand principles, here, as if I deleted the dir after I tarballed it).
So I take it there is no way to do what I was asking? It must be decompressed with gunzip, appended, the re-gzipped? Too bad it can't work more like zip files, of course in other ways, tar is much more powerful.
I'm curious tho, in what I've read in the past about tarballing, if it is tarballed using the -z argument, each file is individually gzipped then added to the tar. I was reading a text written in 1999, tho (SAM'S teach yourself shell programming in 24 hours, which was an excellent starting point).
I just tried the above and, of course, it worked. So has the behaviour of the -z arg changed to adding all the files to the tar then gzipping it? I'm curious because this has implications in creating a large tar file that if it were done along the way would be smaller vs creating a tar, then gzipping, which might create storage problems.
if you have access to GNU tar, you can use --append (-r)
---------- Post updated at 04:02 PM ---------- Previous update was at 03:59 PM ----------
sorry, scratch that - you can do it w/ tar or gtar (instead of tar cf tarfile file1 file2 etc. do tar rf tarfile newfiletoadd)
Doesn't work on compressed files as above. The output for viewing pleasure
I'll just write a script and gunzip it and gzip it back. Thanks all. Was hoping for a more elegant soln. Perhaps this is what zip programs do in the background anyway.
I'm curious to know how do I add an empty log file (test1.log) to an existing text file to monitor all the changes made to a.txt.
Is this expression
export PATH=$PATH:/home/test1.log
right to be added to the text file a.txt? (5 Replies)
Hi All,
We are planning to migrate from Solaris to AIX, and we have a requirement to move all files modified in last 7 days to AIX.
i found many helpful forums on this site but somehow the issue was still not solved:
Used the following command from the directory which we want to scan
... (6 Replies)
I was wondering if anyone can point me to some topics, material, or tutorials that can help me write a shell script that creates a second script that is a Self-extracting tarball. Don't want any actual code obviously because this is a school project, but I feel my teacher didn't well cover the... (3 Replies)
This is for Red Hat Enterprise Linux Client release 5.7 (Tikanga).
Wanna extract entire contents of a tar.gz to a folder of my choosing. Thanks (2 Replies)
I wanna make a backup tarball. I wanna write a script that makes tarball of the current directory.
There are lots of files so I cant type all files, I wanna make the tarball by excluding few files.
Like there 1000 files in a directory I wanna create a tarball containing 98 files of that... (1 Reply)
hi,
I am in a weird situation. I have a parent tarball which contains 2 sub tarballs.
The structure is such :
Parent.tar.gz ---- > child1.tar.gz and child2.tar.gz
I need to get the size of the parent tarball without untaring it
I know that the command is gunzip -c parent.tar.gz | wc -c ... (1 Reply)
i have some 100 of lines from a script o/p into a file called naveed.txt
below some of the lines:
1-GH32X, CC, AMR, Number of Intervals Not Inserted: 1 / 95
1-150KP1, CC, AMR, Number of Intervals Not Inserted: 1 / 96
1-VWEMR, CC, AMR, Number of Intervals Not Inserted: 1 / 98
1-15HM1A, CC,... (5 Replies)