This is a multi-part message in MIME format.
------_=_NextPart_001_01C3EB4C.A05B4044
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Thanks, Mark. This script is way cool, and I'll tell you why.=20
=20
Our environment uses ADIC Scalar1000s. Not often, but around 5 times in
the past 3 years, the robot gets a tape stuck in its gripper (8mm AIT2).
When this happens, NetBackup will try to load a new tape into the
gripper, find each one, in turn, unable to be picked up by the robot and
will freeze.
=20
In other words, when the robot gets a tape stuck in its gripper, within
minutes of this, all scratch tapes in the entire library will be frozen.
If there's a vault session running, it will put the tapes in the
duplicate pool and then freeze them, making it necessary to not only
unfreeze them but deassign them first.
=20
Since it's happened so infrequently, I haven't really gone to any
lengths to script my way out of it. But it just so happens that it
occurred this morning. And what do I find in my inbox, but this lovely
script! =20
=20
This list rocks!
Nancy=20
-----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 Donaldson,
Mark
Sent: Tuesday, February 03, 2004 10:28 AM
To: 'koconnor AT midsouth.rr DOT com';
veritas-bu AT mailman.eng.auburn DOT edu
Subject: RE: [Veritas-bu] automated ejection of full tapes
=09
=09
I'd suggest (if your goal is to eject tapes that will no longer
be written to) that you eject frozen & suspended tapes, too.
=20
Anyway, here's a ksh script that'll identify
full/frozen/suspended tapes that are in-library and print a list. It's
a simple modification of one I use to eject for tape rotation - I've
just stripped out the timers I use to keep from pulling recently used
tapes. Just feed it into your tape eject script.
=20
-M
=20
#!/bin/ksh
=20
PROGNAME=3D`basename $0`
TMPFILE1=3D/tmp/$PROGNAME.1.$$
TMPFILE2=3D/tmp/$PROGNAME.2.$$
=20
=09
PATH=3D$PATH:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd:/=
u
sr/openv/volmgr/bin
=20
# Get scrach pool number
spname=3D`vmpool -listscratch | tail -1`
spnum=3D`vmpool -listall | \
awk '{if ($2=3D=3D"number:") {pnum=3D$3}
if ($2=3D=3D"name:" && $3=3D=3D"'$spname'") {print
pnum}}'`
=20
#get list of media & filter to frozen, full, or suspended (skips
scratch)
bpmedialist -l -mlist | \
awk 'BEGIN { scpool=3D'$spnum' }
{if ( $13!=3D$scpool && \
( int($15/8)%2=3D=3D1 || \
$15%2=3D=3D1 || \
int($15/2)%2=3D=3D1 )) {print $1}}' > $TMPFILE1
=20
#TMPFILE1 contains a list of matching tapes regardless
#of location so now sort to in-library stuff
=20
vmquery -a -w | awk '$8!=3D"-" {print $8"\t"$1}' >$TMPFILE2
=20
echo "Robot\tTape\n-----\t------"
for tape in `cat $TMPFILE1`
do
awk '$2=3D=3D"'$tape'" {print}' $TMPFILE2
done | sort
=20
[ -f $TMPFILE1 ] && rm $TMPFILE1
[ -f $TMPFILE2 ] && rm $TMPFILE2
=20
exit
=09
-----Original Message-----
From: koconnor AT midsouth.rr DOT com
[mailto:koconnor AT midsouth.rr DOT com]
Sent: Tuesday, February 03, 2004 5:54 PM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] automated ejection of full tapes
=09
=09
=20
Does anyone have a script that will take the info from,
say the bpmedialist output, create a list, and eject the FULL tapes from
a TLD library to the mail slots? I have checked the archives and found
a few examples that were similar, but a bit more elaborate than what I
need. I think from the research=20
I have done, that you can use the vmquery command with
the -ev option for the eject? I would appreciate any suggestions/help.
BTW, I am running Netbackup 4.5 on Solaris 2.6 with a StorEdge L11000
that has 10 mail slots. Drives are DLT 7000. Thanks again.
------_=_NextPart_001_01C3EB4C.A05B4044
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2726.2500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><SPAN class=3D782332218-04022004><FONT face=3DArial color=3D#0000ff =
size=3D2>Thanks, Mark. This script is way cool, and I'll tell you=20
why. </FONT></SPAN></DIV>
<DIV><SPAN class=3D782332218-04022004><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D782332218-04022004><FONT face=3DArial color=3D#0000ff =
size=3D2>Our=20
environment uses ADIC Scalar1000s. Not often, but around 5 times =
in the=20
past 3 years, the robot gets a tape stuck in its gripper (8mm =
AIT2). When=20
this happens, NetBackup will try to load a new tape into the gripper, =
find each=20
one, in turn, unable to be picked up by the robot and will=20
freeze.</FONT></SPAN></DIV>
<DIV><SPAN class=3D782332218-04022004><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D782332218-04022004><FONT face=3DArial color=3D#0000ff =
size=3D2>In=20
other words, when the robot gets a tape stuck in its gripper, within =
minutes of=20
this, all scratch tapes in the entire library will be frozen. If =
there's a=20
vault session running, it will put the tapes in the duplicate pool and =
then=20
freeze them, making it necessary to not only unfreeze them but deassign =
them=20
first.</FONT></SPAN></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2></FONT> </DIV>
<DIV><SPAN class=3D782332218-04022004><FONT face=3DArial color=3D#0000ff =
size=3D2>Since=20
it's happened so infrequently, I haven't really gone to any lengths to =
script my=20
way out of it. But it just so happens that it occurred this =
morning. =20
And what do I find in my inbox, but this lovely script! =20
</FONT></SPAN></DIV>
<DIV><SPAN class=3D782332218-04022004><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D782332218-04022004><FONT face=3DArial color=3D#0000ff =
size=3D2>This=20
list rocks!</FONT></SPAN></DIV><!-- Converted from text/rtf format -->
<P><SPAN lang=3Den-us><FONT face=3D"Monotype =
Corsiva">Nancy</FONT></SPAN> </P>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr =
align=3Dleft><FONT=20
face=3DTahoma size=3D2>-----Original Message-----<BR><B>From:</B>=20
veritas-bu-admin AT mailman.eng.auburn DOT edu=20
[mailto:veritas-bu-admin AT mailman.eng.auburn DOT edu] <B>On Behalf Of=20
</B>Donaldson, Mark<BR><B>Sent:</B> Tuesday, February 03, 2004 10:28=20
AM<BR><B>To:</B> 'koconnor AT midsouth.rr DOT com';=20
veritas-bu AT mailman.eng.auburn DOT edu<BR><B>Subject:</B> RE:
[Veritas-bu]=20
automated ejection of full tapes<BR><BR></FONT></DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff size=3D2>I'd=20
suggest (if your goal is to eject tapes that will no longer be written =
to)=20
that you eject frozen & suspended tapes, too.</FONT></SPAN></DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>Anyway, here's a ksh script that'll identify =
full/frozen/suspended=20
tapes that are in-library and print a list. It's a simple =
modification=20
of one I use to eject for tape rotation - I've just stripped out =
the=20
timers I use to keep from pulling recently used tapes. Just feed =
it into=20
your tape eject script.</FONT></SPAN></DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>-M</FONT></SPAN></DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>#!/bin/ksh</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>PROGNAME=3D`basename=20
=
$0`<BR>TMPFILE1=3D/tmp/$PROGNAME.1.$$<BR>TMPFILE2=3D/tmp/$PROGNAME.2.$$</=
FONT></SPAN></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2></FONT> </DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff=20
=
size=3D2>PATH=3D$PATH:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/a=
dmincmd:/usr/openv/volmgr/bin</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff size=3D2>#=20
Get scrach pool number<BR>spname=3D`vmpool -listscratch | tail=20
-1`<BR> spnum=3D`vmpool -listall |=20
\<BR> awk '{if =
($2=3D=3D"number:")=20
=
{pnum=3D$3}<BR> &nbs=
p; =20
if ($2=3D=3D"name:" && $3=3D=3D"'$spname'") {print=20
pnum}}'`</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff size=3D2>#get=20
list of media & filter to frozen, full, or suspended (skips=20
scratch)<BR>bpmedialist -l -mlist | \<BR> awk 'BEGIN { =
scpool=3D'$spnum'=20
}<BR> {if ( =
$13!=3D$scpool =20
&& \<BR> =
(=20
int($15/8)%2=3D=3D1 ||=20
=
\<BR> &n=
bsp; =20
$15%2=3D=3D1 ||=20
=
\<BR> =20
int($15/2)%2=3D=3D1 )) {print $1}}' > $TMPFILE1</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>#TMPFILE1 contains a list of matching tapes regardless<BR>#of =
location=20
so now sort to in-library stuff</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>vmquery -a -w | awk '$8!=3D"-" {print $8"\t"$1}'=20
>$TMPFILE2</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff size=3D2>echo=20
"Robot\tTape\n-----\t------"<BR>for tape in `cat =
$TMPFILE1`<BR>do<BR> =20
awk '$2=3D=3D"'$tape'" {print}' $TMPFILE2<BR>done | =
sort</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff size=3D2>[ -f=20
$TMPFILE1 ] && rm $TMPFILE1<BR>[ -f $TMPFILE2 ] && rm=20
$TMPFILE2</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D146521918-03022004><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>exit<BR></FONT></SPAN></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
size=3D2>-----Original Message-----<BR><B>From:</B> =
koconnor AT midsouth.rr DOT com=20
[mailto:koconnor AT midsouth.rr DOT com]<BR><B>Sent:</B> Tuesday, February =
03, 2004=20
5:54 PM<BR><B>To:</B> =
veritas-bu AT mailman.eng.auburn DOT edu<BR><B>Subject:</B>=20
[Veritas-bu] automated ejection of full tapes<BR><BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Does anyone have a script that will =
take the=20
info from, say the bpmedialist output, create a list, and eject =
the=20
FULL tapes from a TLD library to the mail slots? I =
have=20
checked the archives and found a few examples that were similar, but =
a bit=20
more elaborate than what I need. I think from the research=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I have done, that you can use the =
vmquery=20
command with the -ev option for the eject? I would=20
appreciate any suggestions/help. BTW, I am running Netbackup =
4.5 on=20
Solaris 2.6 with a StorEdge L11000 that has 10 mail =
slots. =20
Drives are DLT 7000. Thanks=20
again.</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
=00
------_=_NextPart_001_01C3EB4C.A05B4044--
|