All pastes #157810 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-09-01 19:50 UTC
rendered paste body
#! /bin/sh 

#Umount tape in bconsole
echo "unmount"|bconsole

# Set variable block mode 
# If in doubt, run tapeinfo -f /dev/sg0 - should be 0 
mt -f /dev/nst0 defblksize 0 

# Rewind the tape 
mt -f /dev/nst0 rewind 

# Eject the tape 
mt -f /dev/nst0 eject 

echo
echo "!!! Troque a fita, por favor!!!"
echo "Esperando 2 minutos. . ."

#Wait switch taoe
PASS=1
for i in [ "$PASS" = 120 ]
do
	PASS=`expr $PASS+ 1`
	sleep 1
done


#Get tape in use
echo "status storage"|bconsole|grep dat-
echo

echo -e "Qual fita voce inseriu???"
read tape
echo
echo -e"A fita a ser apagada e >>>>>>> $tape <<<<<<<"
echo "Voce confirma?"
read confim

if [ "$confim" = "S" -o "$confim" = "s" ]
then
	echo "mount"|bconsole
	echo "purge jobs volume=$tape"|bconsole
	echo "Fita apagada e montada com sucesso!"
else
	echo "Saindo..."
	echo
	echo -e "Apague a fita manualmente:"
	echo -e ">>># bconsole"
	echo -e ">>>* list media"
	echo -e ">>>* purge jobs volume='mediaid'"
fi
exit 0