For When You Can't Have The Real Thing
[ start | index | login ]
start > Veritas NetBackup > Expiring Tapes

Expiring Tapes

Created by dave. Last edited by dave, 14 years and 232 days ago. Viewed 4,102 times. #3
[diff] [history] [edit] [rdf]
labels
attachments

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
no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt