Veritas-bu

[Veritas-bu] tape eject after backup - a script that might wo rk for you too....

2000-11-29 10:51:36
Subject: [Veritas-bu] tape eject after backup - a script that might wo rk for you too....
From: David A. Chapa david AT datastaff DOT com
Date: Wed, 29 Nov 2000 07:51:36 -0800 (PST)
First of all, thank you.


I think the easiest way to accomplish what you wish is to set POOLNAME
to some volume pool you want to use then I would put the
following inside the loop 

POOLNAME=My_Pool
.
.
.
for MEDIA in $DESIREDMEDIA
vmquery -m $MEDIA -bx | grep $POOLNAME > /dev/null

if [ $? -eq 0 ];then
vmchange to move it out of the robot
fi

Does this make sense?  Is this what you are trying to accomplish?

David
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David A. Chapa
Consulting Manager
DataStaff, Inc.
847 413 1144

On Wed, 29 Nov 2000, Donaldson, Grant wrote:

> Greetings!
> 
>       This e-mail is for those of you who are tired of ejecting one tape
> at a time out of your tape libraries with the Veritas Media Manager GUI
> (v3.2)interface and don't have your own script. We made this script because
> we have to do a lot of ejecting of active backup tapes(copy 1) out of our
> tape library in order to make room for the next weekend's full backups and
> duplication run.  If this doesn't apply to you, please ignore the
> following......
> 
>       An e-mail from David A. Chappa (November 14, 2000 9:00AM) on how to
> utilize the vmchange command to eject tapes out of the silo via the
> undocumented "-e" parameter (thank you David!) inspired me to have the
> following script put together. It allows you to eject media that are in the
> silo to the CAP/outport (we are using a STK 9740 Tape Library) that fall
> within the date and time range that you specify.  Since we only have a 14
> slot CAP, it stops after the 14th eject and prompts you to clear the CAP and
> press a key to continue with the next 14, and so on.  
> 
>       Please note the following regarding the script:
>       
> - It is intended to be used after you have already ejected your duplicate
> tapes out of the silo for the date range that you are specifying. This is
> because it doesn't differentiate between tape pools and you may
> inadvertently eject your duplicate tapes that you normally use a product
> such as Veritas' BpVault to autoeject.  I couldn't figure out how to specify
> what pool of tapes to use, so if anyone has any suggestions please let me
> know. 
> 
> -It assumes that a Volume Group value of "00_000_TLD" is assigned to those
> media that are currently located in the silo. 
> 
> Grant
> 
> 
> #!/bin/sh
> 
> MEDIAINSILO="/tmp/mediainsilo"
> NBDUPLICATES="/tmp/nbduplicates"
> #First read in the required parameters:
> 
> VALIDDATES=true
> while  $VALIDDATES 
> do
> echo "Please enter the start date in the form mm/dd/yy"
> read STARTDATE
> echo "\nPlease enter the start time in the form hh:mm:ss"
> read STARTTIME
> echo "\nPlease enter the end date in the form mm/dd/yy"
> read ENDDATE
> echo "\nPlease enter the end time in the form hh:mm:ss"
> read ENDTIME
> if [ "{STARTDATE:=NULL}" = "NULL" -o "{STARTTIME:=NULL}" = "NULL" -o
> "{ENDDATE:=NULL}" = "NULL"  -o "{ENDTIME:=NULL}" = "NULL" ]
> then
> echo "Illegal parameter(s) entered"
> else
> VALIDDATES=false
> echo "You want start date/time = $STARTDATE $STARTTIME and end date/time =
> $ENDDATE $ENDTIME"
> echo "Is this correct (y/n)"
> read yn
> if [ "{yn:=NULL}" = "NULL" -o "$yn" = "y" -o "$yn" = "Y" ]
> then
> VALIDDATES=false
> else 
> VALIDDATES=true
> fi
> fi
> done
> 
> #Get a list of media to be ejected
> DESIREDMEDIA=`/usr/openv/netbackup/bin/admincmd/bpimagelist -media -idonly
> -d $STARTDATE $STARTTIME  -e $ENDDATE $ENDTIME | sort`
> 
> if [ "{DESIREDMEDIA:=NULL}" = "NULL" ]
> then
> echo "No media to be ejected that meet the criteria"
> exit 9
> fi
> 
> /usr/openv/volmgr/bin/vmquery -v 00_000_TLD -b | grep TLD | awk '{ print $1
> }' | sort > $MEDIAINSILO
> 
> /usr/openv/volmgr/bin/vmquery -b -pn NB_Duplicates | grep TLD | awk '{ print
> $1 }' | sort > $NBDUPLICATES
> 
> 
> comm -3 $MEDIAINSILO $NBDUPLICATES > $MEDIAINSILO.1
> mv $MEDIAINSILO.1 $MEDIAINSILO
> for MEDIA in $DESIREDMEDIA
> do
> # first search
> TEST=`grep -c $MEDIA $MEDIAINSILO`
> 
> if [ "$TEST" = "0" ]
> then
>       # desired media is not in the silo
>       echo "$MEDIA - Desired Media is not in silo"
> else
> #     echo $MEDIA
>       /usr/openv/volmgr/bin/vmchange -vh tcstor1 -res -m $MEDIA -mt HCART
> -rt none -rc1 0 -e
>       RETCODE=$?
>       if [ "$RETCODE" = "221" ]
>       then 
>               # CAPS are full request user intervention
>               echo "ATTENTION: CAPS are full - please empty and press
> [ENTER] to continue"
>               read dummy
>               /usr/openv/volmgr/bin/vmchange -vh tcstor1 -res -m $MEDIA
> -mt HCART -rt none -rc1 0 -e
>       fi
> fi
> done
> 
> echo "All done"
> 
> 
> 
> 
> 
>       A portion of David's e-mail:
> 
> > ----------
> > From:       David A. Chapa[SMTP:david AT datastaff DOT com]
> > Sent:       November 14, 2000 9:00 AM
> > To:         shyam hazari; veritas-bu AT mailman.eng.auburn DOT edu
> > Subject:    RE: [Veritas-bu] tape eject after backup
> > 
> > 
> > 
>       "Here what I want to do is to eject the tape out
> > of the tape drive to the outport. How do I achieve this ?"
> > 
> > !>>/usr/openv/volmgr/bin/vmchange -vh $MASTER -res -m $MEDIAID \
> > !>>    -mt $DENSITY -rt none -rc1 0 -rc2 0 [ -v $volume_group ] -e
> > 
> > /usr/openv/volmgr/bin/vmchange -vh tcstor1 -res -m xxxxx -mt hcart -rt
> > none -rc1 0 -v 00_000_TLD -e
> > 
> > 
> > _______________________________________________
> > Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
> > http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
> > 
> _______________________________________________
> Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
> http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
>