(dump) Hanoi algorithm
David Brown
david at varian.UUCP
Thu Aug 30 09:57:40 AEST 1984
We too were once bitten by not being able to read dump tapes that were
written without any error messages appearing. Since then, we added
to the end of all our scripts that write dump tape a call to
dump.verify, a shell script that retrieves the last file on the dump
tape - it seems to me that this is a pretty good test of the tape,
as the whole dump tape is read.
Here it is - it contains a few non-standard things. mt is a Berkeley
program which uses mtioctl calls; if you don't have it, you can work
around it. Restor (with a capital R) is a version of restor that
doesn't prompt for volume #, so it can be run from a script (almost all
of our dumps fit on one tape).
We run 4.1BSD on a 11/780 and 2.8BSD/v7 hybrid on a pdp11/70.
cut here
=====================
: dump.verify.sh:
:
: script to verify that we can restore the last file on a dump tape.
:
: Restor is a version of restor that has been modified so that it always
: assumes volume 1 and does not prompt for volume number.
:
: Note that this only checks the first virtual tape thoroughly.
:
: Get the name of the last file on the dump.
mt rew : rewind the tape
sleep 30
fn=`dumpdir f /dev/rmt8 | sort -n | tail -1 `
echo fn = $fn
: Set to fail if $fn is not set [-u], and assign words in fn to $1, $2, etc.
set -u $fn
: Restore the last file on the dump.
echo dump.verify: restoring file $2
if /bin/Restor xf /dev/rmt8 $2
then
if rm -f $1
then
echo
echo 'dump.verify: verification succeeded'
echo
rm rst*
exit
fi
fi
echo
echo 'dump.verify: ****** VERIFICATION FAILED ******'
echo
exit
========= end ============
--
David Brown (415) 945-2199
Varian Instruments 2700 Mitchell Dr. Walnut Creek, Ca. 94598
{zehntel,amd,fortune,resonex}!varian!david
More information about the Comp.unix.wizards
mailing list