A Script For Expiring Tapes
We want to expire tapes in the 'full_backup' volume pool that are currently in the robot (presumably because they've been rotated back as per normal).
If you run without a parameter, it just lists the media IDs it wants to expire.
If you run it with any parameter, it steps through the list one at a time, shows the information line for that media ID, then offers to expire it.
#!/bin/ksh
# Written for NetBackup 3.4! Yes we're banging rocks together here.
if [ -z "$1" ] ; then
# tapes not in a robot will have '---' in their string.
/usr/openv/volmgr/bin/vmquery -a -bx | egrep -v -- --- | grep 'full_' | awk '{print $1, $6, "Last Mounted:",$12,$13}' | sort | less
else
# expire the tapes.
for i in `/usr/openv/volmgr/bin/vmquery -a -bx | egrep -v -- --- | grep 'full_' | awk '{print $1}'` ; do
# print out the information line for this tape
/usr/openv/volmgr/bin/vmquery -a -bx | grep $i
# this is interactive.
/usr/openv/netbackup/bin/admincmd/bpexpdate -d 0 -ev $i
# if the user says no, this will fail.
# in our case, the 'Scratch' pool is pool ID 5.
# tapes are pulled from this pool as required.
/usr/openv/volmgr/bin/vmchange -p 5 -m $i
done
fi