Veritas-bu

[Veritas-bu] Rotating Tapes

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

<Prev in Thread] Current Thread [Next in Thread>