multi-volume archives

Steve O'Hara-Smith steve at sohara.org
Sun Sep 22 06:50:32 UTC 2019


On Sun, 22 Sep 2019 11:26:53 +0700
Victor Sudakov <vas at mpeks.tomsk.su> wrote:

> Steve O'Hara-Smith wrote:
> 
> [dd]
> 
> > > However, this understanding of multiple volumes is not convenient for
> > > writing to a formatted flash drive.
> > 
> > 	You can use -L <size> and perhaps the --new-volume-script
> > option 
> 
> Only if the --new-volume-script can change the archive name.

	Which of course it can - from the documentation:

-------------------------------------------------------------------------
The volume script can instruct tar to use new archive name, by writing in
to file descriptor $TAR_FD (see below for an example). 
-------------------------------------------------------------------------
#! /bin/bash
# For this script it's advisable to use a shell, such as Bash,
# that supports a TAR_FD value greater than 9.

echo Preparing volume $TAR_VOLUME of $TAR_ARCHIVE.

name=`expr $TAR_ARCHIVE : '\(.*\)-.*'`
case $TAR_SUBCOMMAND in
-c)       ;;
-d|-x|-t) test -r ${name:-$TAR_ARCHIVE}-$TAR_VOLUME || exit 1
          ;;
*)        exit 1
esac

echo ${name:-$TAR_ARCHIVE}-$TAR_VOLUME >&$TAR_FD
----------------------------------------------------------------------

-- 
Steve O'Hara-Smith <steve at sohara.org>


More information about the freebsd-questions mailing list