Veritas-bu

[Veritas-bu] RE: Veritas-bu digest, Vol 1 #2533 - 6 msgs

2003-09-19 13:26:30
Subject: [Veritas-bu] RE: Veritas-bu digest, Vol 1 #2533 - 6 msgs
From: Josh.Goldfarb AT blackrock DOT com (Goldfarb, Josh)
Date: Fri, 19 Sep 2003 13:26:30 -0400
Since enough people showed interest in our script, I decided to share
this with the list.  Remember this is a custom script and is dangerous
for any OPS staff.  Deassign and erase tape and move to scratch.  

Any suggestions on changing this please reply to me. Thx josh

Be very careful.. Dangerous.....


#!/bin/ksh
# This script will unfreeze and deassign the volume pool for media
input.
#
# Written For BlackRock Financial Data Protection Team by Jamie
Crapanzano and Josh Goldfarb.  
#
print -n "Please input the tape you would like to unfreeze and deassign:
"
read TAPE
print -n "This will erase any reference to $TAPE from the Netbackup
catalogue.  
It will become a blank tape, placed in the scratch pool.  
Do you want to proceed? (y/n) "
read answer
#
if [ "$answer" = "y" -o "$answer" = "Y" ]; then
        echo '  '
        echo "========== continuing =========="
        echo '  '
        else
        echo "Exiting now..."
        exit 0
fi
#
print -n "$TAPE is in ";D:/VERITAS/Volmgr/bin/vmquery.exe -m $TAPE |
grep pool | awk '{print $1,$2,$3,$4}'
echo '   '
print "(Ignore any eror mesages regarding media id not being found in NB
media database and/or MM volume database - these are benign...)"
echo '   '
# Variable definitions from user input
#
POOL=`D:/VERITAS/Volmgr/bin/vmquery.exe -m $TAPE | grep pool | awk
'{print $4}' |awk -F"(" '{print $2}' | awk -F")" '{print $1}'`
MSERV=`D:/VERITAS/Netbackup/bin/admincmd/bpmedialist.exe -mlist -ev
$TAPE | grep Server | awk '{print $4}'`
#MSERV=`D:/VERITAS/Volmgr/bin/vmquery.exe -m $TAPE | grep "robot host:"
| awk '{print $3}'`
#
echo '  '
print "Media server for $TAPE is $MSERV"
echo '   '
#
echo '  '
# Unfreezing/Deassigning Portion
echo "=========== Unfreezing tape now... ==========="
D:/VERITAS/Netbackup/bin/admincmd/bpmedia.exe -unfreeze -ev $TAPE -h
$MSERV
echo '   '
echo "=========== Deassigning tape now... ============="
echo '  '
#D:/VERITAS/Volmgr/bin/vmquery.exe -h $MSERV -deassignbyid $TAPE $POOL 0

D:/VERITAS/Volmgr/bin/vmquery.exe -deassignbyid $TAPE $POOL 0 
echo '  '
echo "============ Sending tape to scratch pool... ====="
echo '  '
D:/VERITAS/Volmgr/bin/vmchange.exe -rh $MSERV -p 2 -m $TAPE 
echo '  '
echo '======= Unfreezing/Deassigning/Moving is complete ========'
echo '   '
echo $MSERV


<Prev in Thread] Current Thread [Next in Thread>
  • [Veritas-bu] RE: Veritas-bu digest, Vol 1 #2533 - 6 msgs, Goldfarb, Josh <=