/usr/bin/ddstool is in dds2tar 2.5.2-7.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | #!/bin/sh
# This tool is in experimental status.
#
# Send me an email, if you have nice ideas.
# weule@uni-duesseldorf.de
#
#====================================================================
# Usage:
#
# First label a tape:
# ddstool create-label 'unique-string and more strings'
#
# To archive something:
# ddstool append pathnames...
#
# To delete the old index-files and make a new label:
# ddstool new-label 'unique-string and more strings'
#
# Each index is stored by the pathnames:
# $A/$unique-string.$file-number (soft link)
# $A/$timestamp-of-the-tapelabel.$file-number (file)
#
#====================================================================
# Sorry that I don't know the right method to extract something.
# For now it's more save to do it by hand.
#
#====================================================================
#
set -v
A=/data/tape
case "$1" in
append)
mt rewind;
L=`mt-dds label | awk '{print $1}' `
T=`mt-dds ts`
mt rewind
mt eom
mt status | grep file
F=`mt status | awk '{ if ($1 == "file") printf("%02d",$4) }'`
echo $A/$T.$F $A/$L.$F
touch $A/$T.$F
ln -f -s $A/$T.$F $A/$L.$F
shift
tar --label "$L" -b 32 -R -v -v --record-file $A/$T.$F --create $*
;;
create-label)
mt rewind
tar --create --label "$2" -b 2
;;
new-label)
mt rewind;
L=`mt-dds label | awk '{print $1}' `
T=`mt-dds ts`
mt rewind
rm $A/$L.* $A/$T.*
L=`echo "$2" | awk '{print $1}'`
if test -f $L.01 ; then
echo $0: ERROR: Label ist schon bekannt!
else
tar --create --label "$2" -b 2
mt rewind
T=`mt-dds ts`
F=00
tar -b 1 -t -v -v -R --record-file $A/$T.$F
ln -f -s $A/$T.$F $A/$L.$F
fi
;;
index)
mt rewind;
L=`mt-dds label | awk '{print $1}' `
T=`mt-dds ts`
mt rewind
B=`mt-dds blksize`
echo $B
tar -v -v -R -t -b $B --record-file $A/$T.$F
mt rewind
mt asf "$2"
F=`mt status | awk '{ if ($1 == "file") printf("%02d",$4) }'`
echo File = $F
echo $A/$T.$F $A/$L.$F
touch $A/$T.$F
ln -f -s $A/$T.$F $A/$L.$F
B=`mt-dds blksize`
echo Blksize = $B
tar -b $B -t -R -v -v --record-file $A/$T.$F
esac
mt rewind
|