Script per il labeling dei tape di amanda
| Attenzione questo articolo è ancora incompleto. Sentiti libero di contribuire cliccando sul tasto edit. |
#!/bin/bash
VERSION=1.0.0
if [ $(id -nu) != "backup" ]
then
echo Yous should run this script as user "backup".
echo Aborting.
exit 127
fi
echo labeltape $VERSION
if [ -z "$1" ]
then
echo "Usage:"
echo "labeltapes TAPESET"
echo "where TAPESET=[A|B|C...]"
echo "Aborting."
exit 127
fi
TAPESET=$1
day[1]="MON"
day[2]="TUE"
day[3]="WED"
day[4]="THU"
day[5]="FRI"
echo -e "\n"
for i in 1 2 3 4 5
do
TAPE="${TAPESET}-0${i}-${day[i]}"
echo -e "\a"
read -n 1 -p "Please insert tape $TAPE and press any key (s=skyp)" KEY > /dev/null
if [ "$KEY" != "s" ]
then
amlabel DailySet1 $TAPE
mt -f /dev/st0 offline
echo -e "\n"
fi
done
echo Finished.
echo -e "\a"
sleep 1
echo -e "\a"