Operating System - Linux
1751952 Members
5036 Online
108783 Solutions
New Discussion

make tar archives muti volume...?

 
SOLVED
Go to solution
Stuart Browne
Honored Contributor

Re: make tar archives muti volume...?

the '-M' in GNU tar is mainly for going to media.

i.e. tar cvMf /dev/fd0 list/of/files

This will automatically split across the diffent media volumes as required, prompting you to insert the next one.

If wanting to use a fixed sized file, then you have to couple it with the '-L' flag, to say how big you want them to get.

i.e. tar cvMLf 3072 /path/to/out.tar path/to/files

However, as you aren't changing 'media' between volume changes, you will probably have to create a script to pass to the '-F' flag to move the individual files into something different.

i.e. tar cvMLFf 3072 /tmp/move.script /tmp/out.tar path/to/files

--- /tmp/move.script ---
#!/bin/bash
VAL=1
until [ ! -f /tmp/out.tar.${VAL} ]
do
VAL=$((VAL + 1))
done
mv /tmp/out.tar /tmp/out.tar.${VAL}
--- /tmp/move.script ---

This will leave you to move the last file to the appropriate number of course.

Anyway.. Some fun for you..

Hope this helps.
One long-haired git at your service...