Penguin

Multivolume TarBalls

Sometimes it is necessary to split a TarBall into several files, ie volumes. The simplest approach is to use split(1)
tar cvzf - dirs/ | split --bytes 1m - archive.tar.gz.part-
Should you need to, you can achieve this goal without split(1) using tar(1)'s -L switch, which sets a volume size limit. While the poorly organized info page for tar(1) mentions this, the man page contains no hint that you must also specify a list of filenames for tar(1) to use by passing more than one -f switch
tar c -L 50000 -f archive1 -f archive2 -f archive3 [ ...? path/
Make sure to specify enough archive files to hold the entire data. If you don't want to be bothered with math the computer can do for you, this script should help
  1. /bin/bash

VOL_SIZE_KB=1000000 BASENAME=archive

TOTAL=$( du -s . | cut -d $'\t' -f 1 ) NUM_VOLUMES=$(( $TOTAL / $VOL_SIZE_KB + 1 ))

tar cv -L $VOL_SIZE $( seq -f "-f $BASENAME-%03g.tar" 1 $NUM_VOLUMES_KB ) --totals *

The example will create 1GB TarBalls of the current directory named archive-*.