[Veritas-bu] Full Media?
2005-06-24 17:42:56
Here's a little script that'll do that for you. It identifies full, frozen,
or suspended tapes in the library. Functionally, the frozen & suspended
ones are removable too since they'll not have data appended to them either.
I've tested this under v5.1.
-M
#!/bin/ksh
PROGNAME=`basename $0`
TMPFILE1=/tmp/$PROGNAME.1.$$
TMPFILE2=/tmp/$PROGNAME.2.$$
PATH=$PATH:/usr/openv/netbackup/bin:/usr/openv/volmgr/bin
PATH=$PATH:/usr/openv/netbackup/bin/admincmd
#get list of media & filter
bpmedialist -l -mlist | \
awk ' {if (int($15/8)%2==1 || \
$15%2==1 || \
int($15/2)%2==1 ){print $1}}' > $TMPFILE1
#TMPFILE1 contains a list of matching tapes regardless
#of location so now sort to in-library stuff
vmquery -a -w | awk '$8!="-" {print $8"\t"$1}' >$TMPFILE2
echo "Robot\tTape\n-----\t------" >&2
for tape in `cat $TMPFILE1`
do
awk '$2=="'$tape'" {print}' $TMPFILE2
done | sort
[ -f $TMPFILE1 ] && rm $TMPFILE1
[ -f $TMPFILE2 ] && rm $TMPFILE2
exit
"ident_libfull_tapes" 30 lines, 730 characters
mdonalds@ug50> cat ident_libfull_tapes
#!/bin/ksh
PROGNAME=`basename $0`
TMPFILE1=/tmp/$PROGNAME.1.$$
TMPFILE2=/tmp/$PROGNAME.2.$$
PATH=$PATH:/usr/openv/netbackup/bin:/usr/openv/volmgr/bin
PATH=$PATH:/usr/openv/netbackup/bin/admincmd
#get list of media & filter
bpmedialist -l -mlist | \
awk ' {if (int($15/8)%2==1 || \
$15%2==1 || \
int($15/2)%2==1 ){print $1}}' > $TMPFILE1
#TMPFILE1 contains a list of matching tapes regardless
#of location so now sort to in-library stuff
vmquery -a -w | awk '$8!="-" {print $8"\t"$1}' >$TMPFILE2
echo "Robot\tTape\n-----\t------" >&2
for tape in `cat $TMPFILE1`
do
awk '$2=="'$tape'" {print}' $TMPFILE2
done | sort
[ -f $TMPFILE1 ] && rm $TMPFILE1
[ -f $TMPFILE2 ] && rm $TMPFILE2
exit
-----Original Message-----
From: veritas-bu-admin AT mailman.eng.auburn DOT edu
[mailto:veritas-bu-admin AT mailman.eng.auburn DOT edu]On Behalf Of
BarberL AT mont.disa DOT mil
Sent: Friday, June 24, 2005 1:02 PM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] Full Media?
Is there a quick way to find out what tapes in the library are full that I
could eject so I can add more scratch tapes?
Thank you,
Layne Barber
Veritas Administration
DISA SMC Montgomery
334-416-3402
596-3402 (dsn)
|
|
|