Updating a tar.gz file
I set up a server and I have a backup partition on it. I would like to schedule jobs that backs up the entire contents of a folder into the spefic days tar.gz file.
For example, every monday, all of the contents will be backed up and gzipped into monday.tar.gz
Every tuesday, all of the contents will be backed up and gzipped into tuesday.tar.gz
However, I have not found a method that updates a COMPRESSED tar file. When I use the -u flag to update the tar file, it says that it cant update a zipped tar file.
Right now, I just have the setup working using tar with no compression but I would love for the compressed files to be updateable.
There's no way to update tar files while they are gzipped, for two reasons:
1. You can't seek in the compressed data.
2. You can't update, since that would affect all later data in the compressed stream.
Of course, both these are _possible_ to fix, but seeking would require walking through the compressed stream from the beginning to the target position, and modifying would require walking through it from the update position to the end, so in effect you are practically unzipping and rezipping it all during the operation.
Can't you just unzip the file while you're updating it, and then rezip it when done?
well, I would like to have this process automated. So using Webmin, I just have the series of tar commands scheduled for each day of the week.
It's very possible to automate it. I can't say that I know what webmin is, but it sounds like it's possible to issue shell commands, right? If so, just issue "gunzip day.tar.gz; tar <options>; gzip day.tar.gz". (As you can see, it's basically just pseudocode, modify it to your config)
If it's not possible using this webmin thing, log in to a shell and use the crontab instead.