[Veritas-bu] Rotating Tapes
2003-09-06 00:03:36
<html><div style='background-color:'><DIV>
<P>Hey this script looks pretty cool. Let me hash over it for awhile and
figure out whats going on and I'll get back with you. Thank
you<BR><BR></P></DIV>
<DIV></DIV>>From: "Donaldson, Mark" <MARK.DONALDSON AT EXPERIANEMS DOT COM>
<DIV></DIV>>To: "'David Thome'" <DRT8243 AT HOTMAIL DOT COM>, veritas-bu AT
mailman.eng.auburn DOT edu
<DIV></DIV>>Subject: RE: [Veritas-bu] Rotating Tapes
<DIV></DIV>>Date: Fri, 5 Sep 2003 09:38:48 -0600
<DIV></DIV>>
<DIV></DIV>>Here's a script I use for my tape rotation (actually a
"simplified" version
<DIV></DIV>>for posting purposes). You can see the default values described
at the top
<DIV></DIV>>of the script. It uses a philosophy that says that a removable
tape should
<DIV></DIV>>be:
<DIV></DIV>> 1. full, suspended or frozen (no more writes possible)
<DIV></DIV>> 2. Not about to expire normally (why pull it out if it's about
to become
<DIV></DIV>>scratch)
<DIV></DIV>> 3. Not recently used read (it might be an "active" tape)
<DIV></DIV>> 4. Not recently written (on week default below - don't pull a
tape
<DIV></DIV>>that's probably your most recent copy.)
<DIV></DIV>>
<DIV></DIV>>The final output is sorted by last write date so your oldest
stuff is on
<DIV></DIV>>top.
<DIV></DIV>>
<DIV></DIV>>The other thing you need is a way to query the current time as
the UNIX time
<DIV></DIV>>integer (UTC). I do it with a little C program called
"seconds_since_epoch"
<DIV></DIV>>(about a dozen lines from the top of the script). It's also
possible to use
<DIV></DIV>>PERL or other stuff for that. Let me know if you need the C
program.
<DIV></DIV>>
<DIV></DIV>>-M
<DIV></DIV>>
<DIV></DIV>>#!/bin/ksh
<DIV></DIV>>
<DIV></DIV>>#Default Hours since backup was written to tape
<DIV></DIV>>HOURSWRITE=168
<DIV></DIV>>
<DIV></DIV>>#Hours within the tape will expire and be reusable
<DIV></DIV>>HOURSEXP=12
<DIV></DIV>>
<DIV></DIV>>#Hours within the tape has not been read
<DIV></DIV>>HOURSREAD=24
<DIV></DIV>>
<DIV></DIV>>PROGNAME=`basename $0`
<DIV></DIV>>TMPFILE1=/tmp/$PROGNAME.1.$$
<DIV></DIV>>TMPFILE2=/tmp/$PROGNAME.2.$$
<DIV></DIV>>
<DIV></DIV>>PATH=$PATH:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd:/usr/o
<DIV></DIV>>penv/volmgr/bin:/usr/openv/local
<DIV></DIV>>
<DIV></DIV>>#call my little C program to get current time in epoch seconds
<DIV></DIV>>now=`seconds_since_epoch`
<DIV></DIV>>
<DIV></DIV>># Get scrach pool number
<DIV></DIV>>spname=`vmpool -listscratch | tail -1`
<DIV></DIV>> spnum=`vmpool -listall | \
<DIV></DIV>> awk '{if ($2=="number:") {pnum=$3}
<DIV></DIV>> if ($2=="name:" && $3=="'$spname'") {print pnum}}'`
<DIV></DIV>>
<DIV></DIV>>#get list of media & filter
<DIV></DIV>>bpmedialist -l -mlist | \
<DIV></DIV>> awk 'BEGIN { now='$now'
<DIV></DIV>> write='$HOURSWRITE' * 3600
<DIV></DIV>> expire='$HOURSEXP' * 3600
<DIV></DIV>> read='$HOURSREAD' * 3600
<DIV></DIV>> scpool='$spnum' }
<DIV></DIV>> {if ( $13!=$scpool && \
<DIV></DIV>> now>=$6+write && \
<DIV></DIV>> now<=$7-expire && \
<DIV></DIV>> now>=$8+read && \
<DIV></DIV>> ( int($15/8)%2==1 || \
<DIV></DIV>> $15%2==1 || \
<DIV></DIV>> int($15/2)%2==1 )) {print $1}}' > $TMPFILE1
<DIV></DIV>>
<DIV></DIV>>#TMPFILE1 contains a list of matching tapes regardless
<DIV></DIV>>#of location so now sort to in-library stuff
<DIV></DIV>>
<DIV></DIV>>vmquery -a -w | awk '$8!="-" {print $8"\t"$1}' >$TMPFILE2
<DIV></DIV>>
<DIV></DIV>>echo "Robot\tTape\n-----\t------"
<DIV></DIV>>for tape in `cat $TMPFILE1`
<DIV></DIV>>do
<DIV></DIV>> awk '$2=="'$tape'" {print}' $TMPFILE2
<DIV></DIV>>done | sort
<DIV></DIV>>
<DIV></DIV>>[ -f $TMPFILE1 ] && rm $TMPFILE1
<DIV></DIV>>[ -f $TMPFILE2 ] && rm $TMPFILE2
<DIV></DIV>>
<DIV></DIV>>exit
<DIV></DIV>>
<DIV></DIV>>-----Original Message-----
<DIV></DIV>>From: David Thome [mailto:drt8243 AT hotmail DOT com]
<DIV></DIV>>Sent: Thursday, September 04, 2003 5:57 PM
<DIV></DIV>>To: veritas-bu AT mailman.eng.auburn DOT edu
<DIV></DIV>>Subject: [Veritas-bu] Rotating Tapes
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>Have a question regarding a good method for tape rotation on a
Storedge L40
<DIV></DIV>>tape library. Looked through the Veritas Media Mgr DC SA guide
and not
<DIV></DIV>>seeing anything worth while. If you know of a good information
source on
<DIV></DIV>>"tape roatation how to" please let me know.
<DIV></DIV>>
<DIV></DIV>>I ran the goodies script, available_media and it's showing
almost all of my
<DIV></DIV>>tapes as "full", and the scratch pool is empty....HELP.!!!!
<DIV></DIV>>
<DIV></DIV>>I have brand new tapes ready to shove in I'm just wondering
about the tapes
<DIV></DIV>>that I pull out (how to do this) but also what's on them, and
what if I need
<DIV></DIV>>them down the road.
<DIV></DIV>>
<DIV></DIV>>Thank you very much for any help you can offer.
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV></div><br clear=all><hr> <a
href="http://g.msn.com/8HMRENUS/2734??PS=">Need more e-mail storage? Get 10MB
with Hotmail Extra Storage. </a> </html>
|
|
|