Veritas-bu

[Veritas-bu] Proper tape rotation process needed

2005-04-26 17:26:09
Subject: [Veritas-bu] Proper tape rotation process needed
From: Mark.Donaldson AT cexp DOT com (Mark.Donaldson AT cexp DOT com)
Date: Tue, 26 Apr 2005 15:26:09 -0600
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_000_01C54AA6.9017CA45
Content-Type: text/plain;
        charset="iso-8859-1"

Here's my old script as an attachment.  Note, it depends on a little C
program I had called "seconds_since_epoch".  I don't have that anymore but
the following PERL code does the same thing.

> cat seconds_since_epoch
#!/usr/bin/perl
$t = time( );
print $t . "\n";


I had forgotten but there's additional timing information that's used to
keep what I termed "active" tapes from being ejected too early.  

For a tape to be ejected:

In-Library               AND        {obvious
(Full OR Frozen OR Suspended ) AND  {no longer being written to
HOURS_SINCE_WRITE > 168  AND        {>1 week old, unlikely restore candidate
HOURS_UNTIL_EXPIRE > 12  AND        {don't pull a tape that's going to
                                    {  return to the scratch pool soon
HOURS_SINCE_READ > 24               {not read in >24 hours, In my experience
                                    {  file restore requests come in sets.


The values above are configurable variables in the script.


HTH - Mark



-----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
Mark.Donaldson AT cexp DOT com
Sent: Tuesday, April 26, 2005 9:52 AM
To: Jeremy.Loukinas AT evenflo DOT com; veritas-bu AT mailman.eng.auburn DOT edu
Subject: RE: [Veritas-bu] Proper tape rotation process needed


I had the same problem, too may tapes in use for the slots available.

I used to use a script that identified tapes that were (full OR frozen OR
suspended) AND in-library.  Those would be ejected and replaced with scratch
tapes.  You'll also need something to identify those tapes on your "aging"
shelf that have fully expired are are ready, therefore, to be re-inserted as
scratch tapes.

The first identification requires you combine "bpmedialist -mlist" & vmquery
output respectively.  The second is just vmquery.

I'll rummage my old scripts and see what I can find -- or search the
archives, I'm sure they're there somewhere.

-M
-----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 Loukinas,
Jeremy
Sent: Monday, April 25, 2005 1:48 PM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] Proper tape rotation process needed


I have an STK L180 that holds over 100 tapes. A lot of our backups have long
retention periods and need to be moved out of the silo for long term
storage. 
What are other people using to manage what comes and goes when? 
 
 Jeremy S. Loukinas        
 

 
 


------_=_NextPart_000_01C54AA6.9017CA45
Content-Type: application/octet-stream;
        name="ident_removable.sh"
Content-Disposition: attachment;
        filename="ident_removable.sh"

#!/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/openv/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 -bx | awk '$1=="'$spname'" {print $2}'

#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

------_=_NextPart_000_01C54AA6.9017CA45--

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