#!/bin/sh # Syntax : les-dlt.sh first-file-no last-file-no # Read DLT tape # Data transfer from TRIACQ system # Bent Ole Ruud, Ole Meyer # UiB, IFJ, Oct 26, 2001 echo "First file no: $1" echo "Last file no: $2" echo "Is this correct [y/n]?" read answer if [ $answer = "y" -o $answer = "Y" ] then echo "OK" first=$1 last=$2 tape=/dev/nst0 echo "Rewinding tape ..." mt -f $tape rewind echo "Copying tape start file, 128 bytes ..." dd if=$tape of=datafile.dat bs=1048576 count=256 echo "Copying shot files" filenr=$first while [ $filenr -le $last ]; do echo "Writing file datafile$filenr.dat" dd if=$tape of=datafile$filenr.dat bs=1048576 count=256 filenr=`expr $filenr + 1` done echo "Rewinding tape ..." mt -f $tape rewoff echo "Done!" else echo "Correct mistakes" fi exit