[Veritas-bu] Rotating Tapes
2003-09-05 11:38:48
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_01C373C3.CC590970
Content-Type: text/plain;
charset="iso-8859-1"
Here's a script I use for my tape rotation (actually a "simplified" version
for posting purposes). You can see the default values described at the top
of the script. It uses a philosophy that says that a removable tape should
be:
1. full, suspended or frozen (no more writes possible)
2. Not about to expire normally (why pull it out if it's about to become
scratch)
3. Not recently used read (it might be an "active" tape)
4. Not recently written (on week default below - don't pull a tape
that's probably your most recent copy.)
The final output is sorted by last write date so your oldest stuff is on
top.
The other thing you need is a way to query the current time as the UNIX time
integer (UTC). I do it with a little C program called "seconds_since_epoch"
(about a dozen lines from the top of the script). It's also possible to use
PERL or other stuff for that. Let me know if you need the C program.
-M
#!/bin/ksh
#Default Hours since backup was written to tape
HOURSWRITE=168
#Hours within the tape will expire and be reusable
HOURSEXP=12
#Hours within the tape has not been read
HOURSREAD=24
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:/usr/openv/local
#call my little C program to get current time in epoch seconds
now=`seconds_since_epoch`
# 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
bpmedialist -l -mlist | \
awk 'BEGIN { now='$now'
write='$HOURSWRITE' * 3600
expire='$HOURSEXP' * 3600
read='$HOURSREAD' * 3600
scpool='$spnum' }
{if ( $13!=$scpool && \
now>=$6+write && \
now<=$7-expire && \
now>=$8+read && \
( 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: David Thome [mailto:drt8243 AT hotmail DOT com]
Sent: Thursday, September 04, 2003 5:57 PM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] Rotating Tapes
Have a question regarding a good method for tape rotation on a Storedge L40
tape library. Looked through the Veritas Media Mgr DC SA guide and not
seeing anything worth while. If you know of a good information source on
"tape roatation how to" please let me know.
I ran the goodies script, available_media and it's showing almost all of my
tapes as "full", and the scratch pool is empty....HELP.!!!!
I have brand new tapes ready to shove in I'm just wondering about the tapes
that I pull out (how to do this) but also what's on them, and what if I need
them down the road.
Thank you very much for any help you can offer.
------_=_NextPart_001_01C373C3.CC590970
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.1226" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=549223115-05092003><FONT face=Arial color=#0000ff
size=2>Here's
a script I use for my tape rotation (actually a "simplified" version for
posting
purposes). You can see the default values described at the top of the
script. It uses a philosophy that says that a removable tape should
be:</FONT></SPAN></DIV>
<DIV><SPAN class=549223115-05092003><FONT face=Arial color=#0000ff
size=2> 1. full, suspended or frozen (no more
writes possible)</FONT></SPAN></DIV>
<DIV><SPAN class=549223115-05092003> <FONT face=Arial
color=#0000ff size=2>2. Not about to expire normally (why pull it out if
it's about to become scratch)</FONT></SPAN></DIV>
<DIV><SPAN class=549223115-05092003> <FONT face=Arial
color=#0000ff size=2>3. Not recently used read (it might be an "active"
tape)</FONT></SPAN></DIV>
<DIV><SPAN class=549223115-05092003> <FONT face=Arial
color=#0000ff size=2>4. Not recently written (on week default below - don't
pull
a tape that's probably your most recent copy.)</FONT></SPAN></DIV>
<DIV><SPAN class=549223115-05092003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face=Arial color=#0000ff size=2>The
final output is sorted by last write date so your oldest stuff is on
top.</FONT></SPAN></DIV>
<DIV><SPAN class=549223115-05092003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face=Arial color=#0000ff size=2>The
other thing you need is a way to query the current time as the UNIX time
integer
(UTC). I do it with a little C program called "seconds_since_epoch"
(about
a dozen lines from the top of the script). It's also possible to use PERL
or other stuff for that. Let me know if you need the C
program.</FONT></SPAN></DIV>
<DIV><SPAN class=549223115-05092003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face=Arial color=#0000ff
size=2>-M</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><SPAN class=549223115-05092003><FONT face="Courier New" color=#0000ff
size=2>#!/bin/ksh</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face="Courier New" color=#0000ff
size=2>#Default Hours since backup was written to
tape<BR>HOURSWRITE=168</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face="Courier New" color=#0000ff
size=2>#Hours within the tape will expire and be
reusable<BR>HOURSEXP=12</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face="Courier New" color=#0000ff
size=2>#Hours within the tape has not been
read<BR>HOURSREAD=24</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face="Courier New" color=#0000ff
size=2>PROGNAME=`basename
$0`<BR>TMPFILE1=/tmp/$PROGNAME.1.$$<BR>TMPFILE2=/tmp/$PROGNAME.2.$$</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face="Courier New" color=#0000ff
size=2>PATH=$PATH:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd:/usr/openv/volmgr/bin:/usr/openv/local</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face="Courier New" color=#0000ff
size=2>#call my little C program to get current time in epoch
seconds<BR>now=`seconds_since_epoch`</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face="Courier New" 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><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face="Courier New" color=#0000ff
size=2>#get list of media & filter<BR>bpmedialist -l -mlist | \<BR>
awk 'BEGIN {
now='$now'<BR>
write='$HOURSWRITE' *
3600<BR>
expire='$HOURSEXP' *
3600<BR>
read='$HOURSREAD' *
3600<BR>
scpool='$spnum' }<BR> {if (
$13!=$scpool &&
\<BR>
now>=$6+write &&
\<BR>
now<=$7-expire &&
\<BR>
now>=$8+read &&
\<BR> (
int($15/8)%2==1 ||
\<BR>
$15%2==1 ||
\<BR>
int($15/2)%2==1 )) {print $1}}' > $TMPFILE1</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face="Courier New" 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><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face="Courier New" color=#0000ff
size=2>vmquery -a -w | awk '$8!="-" {print $8"\t"$1}'
>$TMPFILE2</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face="Courier New" 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><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face="Courier New" color=#0000ff
size=2>[ -f $TMPFILE1 ] && rm $TMPFILE1<BR>[ -f $TMPFILE2 ]
&&
rm $TMPFILE2</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=549223115-05092003><FONT face=Arial><FONT size=2><FONT
color=#0000ff><FONT
face="Courier New">exit</FONT><BR></FONT></FONT></FONT></SPAN></DIV>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> David Thome
[mailto:drt8243 AT hotmail DOT com]<BR><B>Sent:</B> Thursday, September 04,
2003 5:57
PM<BR><B>To:</B> veritas-bu AT mailman.eng.auburn DOT edu<BR><B>Subject:</B>
[Veritas-bu] Rotating Tapes<BR><BR></DIV></FONT>
<DIV><FONT face=Arial size=2>Have a question regarding a good method for tape
rotation on a Storedge L40 tape library. Looked through the Veritas
Media Mgr DC SA guide and not seeing anything worth while. If you know of a
good information source on "tape roatation how to" please let me
know.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I ran the goodies script, available_media and
it's showing almost all of my tapes as "full", and the scratch pool is
empty....HELP.!!!!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have brand new tapes ready to shove in I'm
just
wondering about the tapes that I pull out (how to do this) but also what's on
them, and what if I need them down the road.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thank you very much for any help you can
offer.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C373C3.CC590970--
|
|
|