#!/usr/bin/ksh ############################################################################### # # Module: tape_nbu_expire.sh # Author: Peter R. Schmidt # Description: Force Veritas backup tape to expire on date requested # # Change Log # # Date Name Description................. # 09/25/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 "Force Veritas backup tape to expire on a specific date (or now)." echo "----------------------------------------------------------------" echo echo "Press to see list of used media" read answer echo "searching..." /usr/openv/netbackup/bin/goodies/available_media | grep -v AVAILABLE echo echo "Enter tape volume id to expire 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 expire tape ( to stop)" read answer echo echo "Enter date tape should expire (mm/dd/yy) (or '0' to expire immeadiately)" read EXPDATE bpexpdate -ev $TAPEID -d $EXPDATE if [ $? != 0 ] then echo "Error: problem encountered trying to expire media" exit 1 fi echo echo "Expire Successful " echo done