#!/usr/bin/ksh ############################################################################### # # Module: tape_nbu_freeze_media.sh # Author: Peter R. Schmidt # Description: Update the status of a Veritas backup tape to freeze # # Change Log # # Date Name Description................. # 10/05/00 Peter R. Schmidt Start Program # ############################################################################### PATH=$PATH:/usr/openv/volmgr/bin:/usr/openv/netbackup/bin/admincmd:/usr/openv/netbackup/bin/goodies export PATH while true do while true do echo echo "Update the status of a Veritas backup tape to FREEZE" echo "-----------------------------------------------------" echo echo "Enter 'LIST' to see list of used media or to continue without list." read answer if [ "$answer" = "LIST" -o "$answer" = "list" ] then echo "searching..." /usr/openv/netbackup/bin/goodies/available_media | grep -v AVAILABLE fi echo echo "Enter tape volume id to FREEZE or 'Q' to Quit" read TAPEID if [ $TAPEID = Q -o $TAPEID = q ] then exit 0 fi CNT=`vmquery -m $TAPEID 2>&1 | grep "volume does not exist in database" | wc -l` if [ $CNT = 1 ] then echo echo "Error: that tape id is not in the Veritas media database." echo "Please enter a valid tape id." continue fi break done echo echo "Tape located - Press to FREEZE tape ( to stop)" read answer bpmedia -freeze -ev $TAPEID if [ $? != 0 ] then echo "Error: problem encountered trying to FREEZE media" exit 1 fi echo echo "FREEZE Successful (Brrrr)" echo done