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_01C24AE2.0E43BDA0
Content-Type: text/plain
Correction:
$9!="-" && \
-M
-----Original Message-----
From: Donaldson, Mark [mailto:Mark.Donaldson AT experianems DOT com]
Sent: Friday, August 23, 2002 2:06 PM
To: 'Jeff Kennedy'; NBU List
Subject: RE: [Veritas-bu] Automating reallocation of available tapes
The script below will reset all available tapes regardless of location back
to your scratchpool. To only change those in the libarary, add
$9!="-" \
to the 'awk' script.
HTH - Mark
------------------------
#!/bin/sh
##Auto_ScratchPool
## This script is used to identify all tapes in the robot which are
available
## for use (all expired images) but are not in the "ScratchPool" and change
## them to be in the Scratchpool. This should increase tape availability
for
## all Classes of backups.
## Mark Donaldson - Nov 11, 1999
## Revision History: Nov 1999 - script created.
#
# MDD 3/14/2001 - Remove need to have tape in robot to set back to
Scratchpool
# Should be able to expire anywhere it is located. Will
track
# Offsite & Cabinet stuff with Volume Groups.
PATH=$PATH:/usr/openv/netbackup/bin:/usr/openv/volmgr/bin:/usr/local/bin
PATH=$PATH:/usr/openv/netbackup/bin/admincmd:/usr/openv/local
export PATH
# Note: vmquery col 1 is tape number
# col 3 is tape type
# col 9 is slot num
# col 12 is poolname
# col 20 is "assigned" date
# col 28 is status code (0=regular backups, 1=NB DB, 2=HSM)
tapelist=`vmquery -a -w | awk '$3 !~ /CLN/ && \
$20 ~ /^00\/00\/00/ && \
$12 != "'$SPname'" && \
$28 == 0 {print $1}' `
#Now lookup scratchpool pool number.
SPname=`vmpool -listscratch | tail -1`
SPnum=`vmpool -listall | \
awk -F: '$1=="pool number" {pn=$2}
$1=="pool name" && $2~/^ *'$SPname'$/ {print pn}'`
for eachtape in $tapelist
do
#Tape available for reassignment to scratchpool.
vmchange -p $SPnum -m $eachtape
done
exit
-----Original Message-----
From: Jeff Kennedy [ mailto:jlkennedy AT amcc DOT com <mailto:jlkennedy AT amcc
DOT com> ]
Sent: Friday, August 23, 2002 1:19 PM
To: NBU List
Subject: [Veritas-bu] Automating reallocation of available tapes
I'm pretty sure someone posted an answer to this already but I can't
find it in my archives.
Does anyone have a script that looks at all pools, lists all the media
that is AVAILABLE, figures out which ones are in the library, and then
re-assigns them to SCRATCH?
Thanks.
--
=====================
Jeff Kennedy
Unix Administrator
AMCC
jlkennedy AT amcc DOT com
_______________________________________________
Veritas-bu maillist - Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
<http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu>
------_=_NextPart_001_01C24AE2.0E43BDA0
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<TITLE>RE: [Veritas-bu] Automating reallocation of available tapes</TITLE>
<META content="MSHTML 6.00.2719.2200" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=479501620-23082002><FONT face=Arial color=#0000ff
size=2>Correction:</FONT></SPAN></DIV>
<DIV><SPAN class=479501620-23082002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=479501620-23082002><FONT face=Arial color=#0000ff
size=2>$9!="-" && \</FONT></SPAN></DIV>
<DIV><SPAN class=479501620-23082002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=479501620-23082002><FONT face=Arial color=#0000ff
size=2>-M</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Donaldson, Mark
[mailto:Mark.Donaldson AT experianems DOT com]<BR><B>Sent:</B> Friday, August
23,
2002 2:06 PM<BR><B>To:</B> 'Jeff Kennedy'; NBU List<BR><B>Subject:</B> RE:
[Veritas-bu] Automating reallocation of available tapes<BR><BR></FONT></DIV>
<P><FONT size=2>The script below will reset all available tapes regardless of
location back to your scratchpool. To only change those in the
libarary,
add </FONT></P>
<P><FONT size=2>$9!="-" \</FONT> </P>
<P><FONT size=2>to the 'awk' script.</FONT> <BR><FONT size=2>HTH -
Mark</FONT>
</P>
<P><FONT size=2>------------------------</FONT> <BR><FONT
size=2>#!/bin/sh</FONT> </P>
<P><FONT size=2>##Auto_ScratchPool</FONT> <BR><FONT size=2>## This script is
used to identify all tapes in the robot which are available</FONT> <BR><FONT
size=2>## for use (all expired images) but are not in the "ScratchPool" and
change</FONT> <BR><FONT size=2>## them to be in the Scratchpool. This
should increase tape availability for</FONT> <BR><FONT size=2>## all Classes
of backups.</FONT> </P>
<P><FONT size=2>## Mark Donaldson - Nov 11, 1999</FONT> <BR><FONT size=2>##
Revision History: Nov 1999 - script created.</FONT> <BR><FONT size=2>#</FONT>
<BR><FONT size=2># MDD 3/14/2001 - Remove need to have tape in robot to set
back to Scratchpool</FONT> <BR><FONT
size=2>#
Should be able to expire anywhere it is located. Will track</FONT>
<BR><FONT
size=2>#
Offsite & Cabinet stuff with Volume Groups.</FONT> </P>
<P><FONT
size=2>PATH=$PATH:/usr/openv/netbackup/bin:/usr/openv/volmgr/bin:/usr/local/bin</FONT>
<BR><FONT
size=2>PATH=$PATH:/usr/openv/netbackup/bin/admincmd:/usr/openv/local</FONT>
<BR><FONT size=2>export PATH</FONT> </P>
<P><FONT size=2># Note: vmquery col 1 is tape number</FONT> <BR><FONT
size=2>#
col 3 is tape type</FONT> <BR><FONT
size=2>#
col 9 is slot num</FONT> <BR><FONT
size=2>#
col 12 is poolname</FONT> <BR><FONT
size=2>#
col 20 is "assigned" date</FONT> <BR><FONT
size=2>#
col 28 is status code (0=regular backups, 1=NB DB, 2=HSM)</FONT> </P>
<P><FONT size=2>tapelist=`vmquery -a -w | awk '$3 !~ /CLN/ &&
\</FONT> <BR><FONT
size=2>
$20 ~ /^00\/00\/00/ && \</FONT> <BR><FONT
size=2>
$12 != "'$SPname'" && \</FONT> <BR><FONT
size=2>
$28 == 0 {print $1}' `</FONT> </P>
<P><FONT size=2>#Now lookup scratchpool pool number.</FONT> <BR><FONT
size=2>SPname=`vmpool -listscratch | tail -1`</FONT> <BR><FONT
size=2>SPnum=`vmpool -listall | \</FONT> <BR><FONT size=2> awk
-F:
'$1=="pool number" {pn=$2}</FONT> <BR><FONT
size=2>
$1=="pool name" && $2~/^ *'$SPname'$/ {print pn}'`</FONT> </P>
<P><FONT size=2>for eachtape in $tapelist</FONT> <BR><FONT size=2>do</FONT>
<BR><FONT size=2> #Tape available for reassignment to
scratchpool.</FONT> <BR><FONT size=2> vmchange -p $SPnum -m
$eachtape</FONT> <BR><FONT size=2>done</FONT> <BR><FONT size=2>exit</FONT>
</P><BR><BR>
<P><FONT size=2>-----Original Message-----</FONT> <BR><FONT size=2>From: Jeff
Kennedy [<A
href="mailto:jlkennedy AT amcc DOT com">mailto:jlkennedy AT amcc DOT
com</A>]</FONT>
<BR><FONT size=2>Sent: Friday, August 23, 2002 1:19 PM</FONT> <BR><FONT
size=2>To: NBU List</FONT> <BR><FONT size=2>Subject: [Veritas-bu] Automating
reallocation of available tapes</FONT> </P><BR>
<P><FONT size=2>I'm pretty sure someone posted an answer to this already but
I
can't</FONT> <BR><FONT size=2>find it in my archives.</FONT> </P>
<P><FONT size=2>Does anyone have a script that looks at all pools, lists all
the media</FONT> <BR><FONT size=2>that is AVAILABLE, figures out which ones
are in the library, and then</FONT> <BR><FONT size=2>re-assigns them to
SCRATCH?</FONT> </P>
<P><FONT size=2>Thanks.</FONT> <BR><FONT size=2>-- </FONT><BR><FONT
size=2>=====================</FONT> <BR><FONT size=2>Jeff Kennedy</FONT>
<BR><FONT size=2>Unix Administrator</FONT> <BR><FONT size=2>AMCC</FONT>
<BR><FONT size=2>jlkennedy AT amcc DOT com</FONT> <BR><FONT
size=2>_______________________________________________</FONT> <BR><FONT
size=2>Veritas-bu maillist -
Veritas-bu AT mailman.eng.auburn DOT edu</FONT> <BR><FONT size=2><A
href="http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu"
target=_blank>http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu</A></FONT>
</P></BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C24AE2.0E43BDA0--
|