[Veritas-bu] Permanently removing a tape from netbackup
2006-08-23 21:22:49
Subject: |
[Veritas-bu] Permanently removing a tape from netbackup |
From: |
Mark.Donaldson at cexp.com (Mark.Donaldson AT cexp DOT com) |
Date: |
Wed, 23 Aug 2006 19:22:49 -0600 |
My "obliterate tape" script. Just run intact or disassemble as needed.
It warns of "destroying all data on the tape" but really it's erasing
the tracking info, ie: the image db for the tape.
-M
cat obliterate_tape
#/bin/ksh
PATH=$PATH:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd
PATH=$PATH:/usr/openv/volmgr/bin:/usr/openv/local
export PATH
if [ $# -eq 0 ]
then
echo "Usage: `basename $0` tapenum [tapenum...]"
else
echo "\n\nWARNING: This completely removes a tape from "
echo "Netbackup, destroying all data on the tape. Therefore,"
echo "this could be a very stupid move.\n"
response=""
while [ -z "$response" ]
do
echo "Are you sure. (y/N) \c"
read response
done
response=`echo $response | cut -c1 | tr '[a-z]' '[A-Z]'`
if [ "$response" != "Y" ]
then
echo "\"$response\"... No action taken."
else
echo "OK - it's your funeral."
for tapenum in $*
do
echo "\nStarting $tapenum..."
svr=`bpmedialist -m $tapenum -L 2>/dev/null | \
awk -F= '$1~/Server Host/ {print $2}' | tr -d ' '`
if [ -n "$svr" ]
then
echo "## Media Server \"$svr\""
echo " Erasing images."
bpexpdate -host $svr -force -ev $tapenum -d 0
echo " Unfreezing tape."
bpmedia -h $svr -unfreeze -ev $tapenum
echo " Unsuspending tape."
bpmedia -h $svr -unsuspend -ev $tapenum
fi
pool=`vmquery -w -m $tapenum | awk 'NR>3 {print $13}'`
status=`vmquery -w -m $tapenum | awk 'NR>3 {print $28}'`
if [ -n "$pool" -a -n "$status" ] ; then
echo " Deassigning tape: pool=$pool, status=$status"
vmquery -deassignbyid $tapenum $pool $status
echo " Deleting tape."
vmdelete -m $tapenum
else
echo "Failed lookup of pool or status for $tapenum."
fi
done
fi
echo "Done."
fi
exit
________________________________
From: veritas-bu-bounces at mailman.eng.auburn.edu
[mailto:veritas-bu-bounces at mailman.eng.auburn.edu] On Behalf Of Hindle,
Greg
Sent: Tuesday, August 22, 2006 7:02 AM
To: NB List Mail
Subject: [Veritas-bu] Permanently removing a tape from netbackup
Nb 5.0 mp6 Solaris 9
What is the recommended way, "best practice" to permanently remove tapes
from netbackup? We have some tapes they will be removed from one master
and shipped to another location to a different master. But I want to
make sure that no traces of the tapes remain in the old master. What is
the best way to do this without causing any issues?
Greg
>>> This e-mail and any attachments are confidential, may contain legal,
professional or other privileged information, and are intended solely
for the addressee. If you are not the intended recipient, do not use
the information in this e-mail in any way, delete this e-mail and notify
the sender. CEG-IP1
|
|
|