This script eject Full media for Offsitng. I do not have vault at my end. Mail Slot capacity is 30. After the eject the admin is mailed.
/usr/openv/netbackup/bin/goodies/available_media | grep HCART2 | grep FULL > .Full
list=`cat .Full | cut -f 4,1 | grep -v - | cut -f 1`
/usr/openv/netbackup/bin/admincmd/bpmedialist -summary>.medialist
>.newfile
for i in $list
do
cat .medialist | grep -i $i >>.newfile
done
>.list
echo "Please find the following tapes in cap slot to be ejected " >> .list
echo "" >>.list
cat .newfile | sort -k3 | tail -30 >> .list
tape=`cat .newfile | sort -k3 | tail -15 | awk ' { print $1 } '`
for j in $tape
do
final=$final:$j
done
echo $final > .final
sed "s/^://g" .final > .final2
mailx -s "Tapes eject for `hostname`" username@domain <.list
/usr/openv/volmgr/bin/vmchange -multi_eject -w -res -ml `cat .final2` -rt TLD -rn 1 -rh `hostname`