Thursday, March 19, 2009

When faced with a couple tgzaa / tgzab files ...

Yesterday I was faced with the task of how to uncompress and un-tar two files that represented the backup of a whole server that was decommissioned a few months back, the files were named as so:

vancouver.2008-09-05.2156.tgzaa
vancouver.2008-09-05.2156.tgzab

I tried:
tar xvfz vancouver.2008-09-05.2156.tgzaa vancouver.2008-09-05.2156.tgzab
but got un-friendly error messages to the effect that it wasn't going to happen. Ever.
Then I tried this, on just the first file:
tar xvfz vancouver.2008-09-05.2156.tgzaa

which uncompressed that archive, and ended with an EOF error

after pulling a dozen weeds out of my garden in frustration, a coworker found the answer:
nice -n19 cat redmond.2008-09-05.2156.tgza* gzip -dc - tar xvf -

with this explanation:
nice - to no havily load the server
cat - to join the volumes
gzip -dc - to extract
tar - to unfold the directory structure

It was the joining of the volumes I didn't know had to be done first ... tip of the pen to NF.