#!/bin/bash
FILES="S0001 S0002 S0003"

# density code 0x05 for 45/60 MB (not Writable) 8000 BPI
#              0x10 for 150 MB                  10000 BPI
DEV=/dev/nst0
echo "Rewinding Tape"
mt -f $DEV rewind || exit 1
mt -f $DEV setdensity 0x10 || exit 1
echo "Erasing Tape"
mt -f $DEV erase || exit 1
echo "Rewinding Tape"
mt -f $DEV rewind || exit 1
mt -f $DEV setdensity 0x10 || exit 1
mt -f $DEV status || exit 1

for i in $FILES
do
  echo -n $i" "
  dd if=$i of=/dev/nst0 bs=512 || exit 1
done

mt -f $DEV rewind || exit 1

