Monday 20 August 2018

linux - How to create tar archive split into, or spanning, multiple files?


According to this page, one can let tar create a tar archive "split" into 100 Mb files:



tar -c -M --tape-length=102400 --file=disk1.tar largefile.tgz



The problem is that this command will require you to interactively give a new filename for the next file, after the first file is filled.


Anybody knows of a way to skip this interactive step, and let tar do the "splitting" automatically?



Answer



Take a look at the --new-volume-script option, which lets you replace the prompting mechanism with a different mechanism or with a generated filename. ((tar.info)Multi-Volume Archives in the tar info page.) The problem with split is that you need to cat the pieces back together to do anything, whereas a multivolume archive should be a bit more flexible.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...