[Veritas-bu] count of scratch tapes
2006-05-23 12:30:07
Subject: |
[Veritas-bu] count of scratch tapes |
From: |
dave.markham at fjserv.net (Dave Markham) |
Date: |
Tue, 23 May 2006 17:30:07 +0100 |
I use this script because it actually tells you the amount of scratch in
the jukebox currently and not using the netbackup databases of what it
thinks is in there. Hope its of use. You will just need to change the
P1000 bit in the awk statement to match whatever string gets the path of
your robot from sgscan.
Dave
--------- begin paste ------------
#!/bin/sh
#set -x
#DaveM
VMDIR=/usr/openv/volmgr/bin
NBUDIR=/usr/openv/netbackup/bin
NBUDIRA=$NBUDIR/admincmd
JBINV=/tmp/scratch-in-jukebox-jbinv
#robot parameters
if [ -s /tmp/robot ];then
ROBOT=`cat /tmp/robot`
else
ROBOT=`/opt/openv/volmgr/bin/sgscan | awk -F: '/P1000/ {print $1}'`
echo $ROBOT > /tmp/robot
fi
ROBCMD="$VMDIR/tldtest -r $ROBOT"
#Get Jukebox Inventory
get_jb_inv()
{
cp $JBINV $JBINV.old
echo "s s" | $ROBCMD | egrep "slot|Barcode" > $JBINV
}
#Command finds scratch tapes
#Get Scratchpool name
SPname=`$VMDIR/vmpool -listscratch | tail -1`
#Now lookup scratchpool pool number.
SPnum=`$VMDIR/vmpool -listall | awk -F: '$1=="pool number" {pn=$2}
$1=="pool name" && $2~/^ *'$SPname'$/ {print pn}'`
# Note: vmquery col 1 is tape number
# col 3 is tape type
# col 12 is poolname
# col 20 is "assigned" date
## This works
tapelist=`$VMDIR/vmquery -a -w | awk '$3 !~ /CLN/ && $12 == "'$SPname'"
{print $1}'`
get_jb_inv
echo ""
echo "Tapes contained in L1000 which are SCRATCH"
echo ""
count=0
for x in $tapelist
do
grep -- $x $JBINV > /dev/null
if [ $? = 0 ];then
$VMDIR/vmquery -m $x | egrep "media ID|robot slot|number
of mounts"
count=`expr $count + 1`
fi
done
echo ""
echo "Total number of scratch in Jukebox = $count"
---------- end paste -------------------
Bobby Williams wrote:
> vmquery -pn `vmpool -listscratch | tail -1` -b | grep -v NONE | wc -l
>
> That would get you scratch.
>
> vmquery has switches to let you pick pools or robots or both....
>
>
>
>
> From: "Covington, Garrett" <Garrett.Covington at trizetto.com>
> Date: 2006/05/23 Tue AM 11:26:33 EDT
> To: "'veritas-bu at mailman.eng.auburn.edu'" <veritas-bu at
> mailman.eng.auburn.edu>
> Subject: [Veritas-bu] count of scratch tapes
>
> I run Solaris9 - NBU 5.1mp4
>
>
>
> Is there a good way to output the number or tapes within a pool or robot,
> ie: to count the number of SCRATCH tapes within a robot?
>
>
>
> Thanks,
>
>
>
> Garrett Covington
>
> The TriZetto Group, Inc.
>
> Garrett.Covington at TriZetto.com <mailto:Garrett.Covington at TriZetto.com>
>
> p: 3032046695 at vtext.com <mailto:3032046695 at vtext.com>
>
> w: 303-323-6886
>
> c: 303-204-6695
>
>
>
>
>
>
> Bobby Williams
> 2205 Peterson Drive
> Chattanooga, TN 37421
>
> _______________________________________________
> Veritas-bu maillist - Veritas-bu at mailman.eng.auburn.edu
> http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
>
>
I
|
|
|