Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
TarNotes
Edit
PageHistory
Diff
Info
LikePages
!!! Multivolume [TarBall]s 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: #!/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 [TarBall]s of the current directory named __archive-*__.
3 pages link to
TarNotes
:
TarBall
BackupNotes
UserSubmittedNotes