Sunday, September 6, 2009

how to automatically create/extract multi volume TARs

For the past year(s) or so I've been running into situations where I have created some code snippets to help me out with my (hobby) projects, only to lose them later from .bash_history :-)


This is about to change now, thanks to the great hints I find evey now and then via Jeremy's linkblog and the inspirational "splitting large files with TAR"

First, we need to introduce the following TAR helpers

move.sh


link.sh


Then, we create (i.e. 1MB) TAR multi volume/part archives on the fly


Extracting is again, almost painless :-)



PS. I hope the gist is showing ok, Blogger's preview is blind to it :-(

PPS. The above code was successfully tested on Debian/Ubuntu, on some other platforms (i.e. RedHat) --volno-file might start counting from... 2 (stupid!). You can always modify move.sh to use its own increment scheme (same as link.sh). Take care!

0 comments: