[Veritas-bu] automated ejection of full tapes
2004-02-03 13:27:41
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C3EA83.688BBEB0
Content-Type: text/plain;
charset="iso-8859-1"
I'd suggest (if your goal is to eject tapes that will no longer be written
to) that you eject frozen & suspended tapes, too.
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.
-M
#!/bin/ksh
PROGNAME=`basename $0`
TMPFILE1=/tmp/$PROGNAME.1.$$
TMPFILE2=/tmp/$PROGNAME.2.$$
PATH=$PATH:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd:/usr/o
penv/volmgr/bin
# Get scrach pool number
spname=`vmpool -listscratch | tail -1`
spnum=`vmpool -listall | \
awk '{if ($2=="number:") {pnum=$3}
if ($2=="name:" && $3=="'$spname'") {print pnum}}'`
#get list of media & filter to frozen, full, or suspended (skips scratch)
bpmedialist -l -mlist | \
awk 'BEGIN { scpool='$spnum' }
{if ( $13!=$scpool && \
( 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------"
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: 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
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
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_01C3EA83.688BBEB0
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1276" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff size=2>I'd
suggest (if your goal is to eject tapes that will no longer be written to) that
you eject frozen & suspended tapes, too.</FONT></SPAN></DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff
size=2>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.</FONT></SPAN></DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff
size=2>-M</FONT></SPAN></DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff
size=2>#!/bin/ksh</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff
size=2>PROGNAME=`basename
$0`<BR>TMPFILE1=/tmp/$PROGNAME.1.$$<BR>TMPFILE2=/tmp/$PROGNAME.2.$$</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff
size=2>PATH=$PATH:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd:/usr/openv/volmgr/bin</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff size=2># Get
scrach pool number<BR>spname=`vmpool -listscratch | tail
-1`<BR> spnum=`vmpool -listall |
\<BR> awk '{if ($2=="number:")
{pnum=$3}<BR>
if ($2=="name:" && $3=="'$spname'") {print pnum}}'`</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff size=2>#get
list of media & filter to frozen, full, or suspended (skips
scratch)<BR>bpmedialist -l -mlist | \<BR> awk 'BEGIN { scpool='$spnum'
}<BR> {if ( $13!=$scpool
&& \<BR> (
int($15/8)%2==1 ||
\<BR>
$15%2==1 ||
\<BR>
int($15/2)%2==1 )) {print $1}}' > $TMPFILE1</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff
size=2>#TMPFILE1 contains a list of matching tapes regardless<BR>#of location
so
now sort to in-library stuff</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff
size=2>vmquery -a -w | awk '$8!="-" {print $8"\t"$1}'
>$TMPFILE2</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff size=2>echo
"Robot\tTape\n-----\t------"<BR>for tape in `cat $TMPFILE1`<BR>do<BR> awk
'$2=="'$tape'" {print}' $TMPFILE2<BR>done | sort</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff size=2>[ -f
$TMPFILE1 ] && rm $TMPFILE1<BR>[ -f $TMPFILE2 ] && rm
$TMPFILE2</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=146521918-03022004><FONT face=Arial color=#0000ff
size=2>exit<BR></FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> koconnor AT midsouth.rr DOT
com
[mailto:koconnor AT midsouth.rr DOT com]<BR><B>Sent:</B> Tuesday, February
03, 2004
5:54 PM<BR><B>To:</B> veritas-bu AT mailman.eng.auburn DOT
edu<BR><B>Subject:</B>
[Veritas-bu] automated ejection of full tapes<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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 </FONT></DIV>
<DIV><FONT face=Arial size=2>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.</FONT></DIV></BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C3EA83.688BBEB0--
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Veritas-bu] automated ejection of full tapes, Hector Villalobos
- [Veritas-bu] automated ejection of full tapes, David Chapa
- [Veritas-bu] automated ejection of full tapes,
Donaldson, Mark <=
- [Veritas-bu] automated ejection of full tapes, koconnor AT midsouth.rr DOT com
- [Veritas-bu] automated ejection of full tapes, Robison, Anthony B. (NGIT)
- [Veritas-bu] automated ejection of full tapes, Corbett, Nancy
- [Veritas-bu] automated ejection of full tapes, Robison, Anthony B. (NGIT)
|
|
|