Script per il labeling dei tape di amanda: Difference between revisions

From RVM Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 41: Line 41:
         fi
         fi
done
done
echo Finished.
echo -e "\a\a"
</pre>
</pre>
[[Media:Example.ogg]]

Revision as of 16:56, 23 July 2009

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 -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\a"