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_01C34658.2B799300
Content-Type: text/plain
You can get this from "bpmedialist" pretty easily:
$ bpmedialist -U
Server Host = backup0
id rl images allocated last updated density kbytes
restores
vimages expiration last read <------- STATUS
------->
----------------------------------------------------------------------------
----
000000 0 160 05/20/2003 10:01 05/27/2003 15:23 dlt 93966396
0
MPX 06/03/2003 15:23 N/A EXPIRED FROZEN
000002 3 35 06/29/2003 13:45 06/29/2003 15:56 dlt 64251655
0
MPX 07/30/2003 15:56 07/06/2003 13:37 FULL
000003 4* 84 11/24/2002 09:12 11/24/2002 14:18 dlt 94051385
0
MPX 11/24/2003 13:10 N/A FULL
The expiration date is where I highlighted it.
A little awk parsing will turn this into a one-liner if the form isn't very
good for you.
You might also get a little mileage out of this script. It produces a
summary report on tape usage and a little report on retention levels and the
number of tapes that expire for each level. Note each retention level
includes the previous level, so Expire < 2 weeks is the sum of "Expiring < 1
week" and "1 < Expiring < 2 weeks". The retention levels a drawn from the
NB retention table so it'll auto-config to anything you currently have set.
## General Data Tape Summary
Total Data Tapes: 364
Total Library Tapes: 168
Full Tapes: 255
Empty Tapes: 49
Suspended Tapes: 2
Frozen Tapes: 6
Total Cleaning Tapes: 12
## Retentions
Expiring <= 1 week: 70
Expiring <= 2 weeks: 108
Expiring <= 3 weeks: 132
Expiring <= 1 month: 191
Expiring <= 2 months: 285
Expiring <= 3 months: 286
Expiring <= 6 months: 299
Expiring <= 1 year: 314
Expiring <= 3 years: 315
The script that produces this follows. Note, this calls a little external
program called "seconds_since_epoch" which is a little C program that
returns the Unix time integer. It's also pretty easy to produce in PERL but
nearly impossible to write in standard shell...
#!/bin/ksh
PROGNAME=`basename $0`
VMQUERY=/var/tmp/$PROGNAME.$$.vmquery
BPMEDIA=/var/tmp/$PROGNAME.$$.bpmedia
RET=/var/tmp/$PROGNAME.$$.ret
#Populate file of assigned media
cp /dev/null $BPMEDIA
for svr in `bpstulist | awk '{print $3}' | sort -u`
do
bpmedialist -mlist -l -h $svr >>$BPMEDIA
done
#Retention levels
bpretlevel -l | sort -n -k 2 > $RET
#Volume database
vmquery -a -w | awk 'NR>3 {print}' >$VMQUERY
#Get current unix time integer
now=`seconds_since_epoch`
#Lots of counting
echo "\n## General Data Tape Summary"
awk '$3!~/CLN/ {sum++} END {printf (" %20s: %4d\n","Total Data
Tapes",sum)}' $VMQUERY
awk '$3!~/CLN/ && $8!~/-/ {sum++} END {printf (" %20s: %4d\n","Total
Library Tapes",sum)}' $VMQUERY
awk ' { if (int($15/8)%2) {sum++}} END {printf (" %20s: %4d\n","Full
Tapes",sum)}' $BPMEDIA
awk '$3!~/CLN/ && $20 ~ /^00\/00\/00/ {sum++} END {printf (" %20s:
%4d\n","Empty Tapes",sum)}' $VMQUERY
awk ' { if (int($15/2)%2) {sum++}} END {printf (" %20s: %4d\n","Suspended
Tapes",sum)}' $BPMEDIA
awk ' { if (int($15)%2) {sum++}} END {printf (" %20s: %4d\n","Frozen
Tapes",sum)}' $BPMEDIA
awk '$3~/CLN/ {sum++} END {printf (" %20s: %4d\n","Total Cleaning
Tapes",sum)}' $VMQUERY
echo "\n## Retentions"
prev=0
for retlvl in `awk '{print $1}' $RET`
do
# count tapes in each retention level
label=`awk '$1=='$retlvl' {if ($3~/infinit/) {print "Infinity"} else
{print $3 " " $4}}' $RET`
offset=`awk '$1=="'$retlvl'" {print $2}' $RET`
count=`awk 'BEGIN {sum=0}
{if ('$now'+'$offset'>=$7) {sum++}}
END {print sum}' $BPMEDIA`
# if current count same as previous count then skip-no tapes at this level
if [ $count -ne $prev ]
then
# Use awk function to get pretty print
echo "$label $count" | \
awk '{printf (" Expiring <= %2s %6s: %4d\n",$1,$2,$3)}'
fi
prev=$count
done
rm $BPMEDIA $RET $VMQUERY
exit
HTH -Mark
-----Original Message-----
From: Fabbro, Andrew P [mailto:Fabbro.Andrew AT cnf DOT com]
Sent: Wednesday, July 09, 2003 1:37 PM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] How to tell when all images on a tape will expire?
Let's say I have tape #123456. I want to know when all images on the tape
will expire and it will be scratched. Actually, I have about 2,000 tapes
and I want to run a report that says "these tapes will expire on these
days". We do not mix retention levels but there are many different pools
with different retention levels. No, the available_media script does not
give this information - it
does not address the future.
So...how can I determine that? Seems like a basic bit of management info.
bpimmedia will show me what images are on the tape and when the expire, but
parsing that out for 2,000 tapes and processing it (compare dates) is not
feasible. For one thing, I was hoping to run this report daily and
bpimmedia takes about 3 minutes per tape and there aren't 6,000 minutes in a
day ;)
--
Drew Fabbro
Manager, Unix Systems Group (USG)
fabbro.andrew AT cnf DOT com
Desk: 503.450.3374
Cell: 503.701.0369
------_=_NextPart_001_01C34658.2B799300
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>How to tell when all images on a tape will expire?</TITLE>
<META content="MSHTML 5.50.4926.2500" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=606215519-09072003><FONT face=Arial color=#0000ff size=2>You
can get this from "bpmedialist" pretty easily:</FONT></SPAN></DIV>
<DIV><SPAN class=606215519-09072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face="Courier New" color=#0000ff
size=2>$ bpmedialist -U<BR>Server Host = backup0</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face="Courier New" color=#0000ff
size=2> id rl images
allocated last
updated density kbytes
restores<BR>
vimages expiration last
read <------- STATUS
-------><BR>--------------------------------------------------------------------------------<BR>000000
0 160 05/20/2003 10:01 05/27/2003
15:23 dlt
93966396
0<BR>
MPX <STRONG><EM>06/03/2003
15:23 </EM></STRONG>
N/A
EXPIRED FROZEN</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face="Courier New" color=#0000ff
size=2>000002 3 35 06/29/2003
13:45 06/29/2003 15:56 dlt
64251655
0<BR>
MPX 07/30/2003 15:56 07/06/2003 13:37
FULL</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face="Courier New" color=#0000ff
size=2>000003 4* 84 11/24/2002
09:12 11/24/2002 14:18 dlt
94051385
0<BR>
MPX 11/24/2003 13:10
N/A
FULL</FONT></SPAN></DIV>
<DIV><SPAN class=606215519-09072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face=Arial color=#0000ff size=2>The
expiration date is where I highlighted it.</FONT></SPAN></DIV>
<DIV><SPAN class=606215519-09072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face=Arial color=#0000ff size=2>A
little awk parsing will turn this into a one-liner if the form isn't very good
for you.</FONT></SPAN></DIV>
<DIV><SPAN class=606215519-09072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face=Arial color=#0000ff size=2>You
might also get a little mileage out of this script. It produces a summary
report
on tape usage and a little report on retention levels and the number of
tapes that expire for each level. Note each retention level includes the
previous level, so Expire < 2 weeks is the sum of "Expiring < 1 week" and
"1 < Expiring < 2 weeks". The retention levels a drawn from the NB
retention table so it'll auto-config to anything you currently have
set.</FONT></SPAN></DIV>
<DIV><SPAN class=606215519-09072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face="Courier New" color=#0000ff
size=2>## General Data Tape Summary<BR> Total
Data
Tapes: 364<BR> Total Library Tapes:
168<BR> Full
Tapes:
255<BR>
Empty Tapes: 49<BR> Suspended
Tapes:
2<BR> Frozen
Tapes: 6<BR> Total Cleaning Tapes:
12</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face="Courier New" color=#0000ff
size=2>## Retentions<BR> Expiring <= 1
week: 70<BR> Expiring <= 2 weeks:
108<BR> Expiring <= 3 weeks: 132<BR> Expiring
<= 1 month: 191<BR> Expiring <= 2
months: 285<BR> Expiring <= 3 months:
286<BR> Expiring <= 6 months: 299<BR> Expiring
<= 1 year: 314<BR> Expiring <= 3
years: 315<BR></FONT></SPAN></DIV>
<DIV><SPAN class=606215519-09072003><FONT face=Arial color=#0000ff size=2>The
script that produces this follows. Note, this calls a little external
program called "seconds_since_epoch" which is a little C program that returns
the Unix time integer. It's also pretty easy to produce in PERL but
nearly
impossible to write in standard shell...</FONT></SPAN></DIV>
<DIV><SPAN class=606215519-09072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face="Courier New" color=#0000ff
size=2>#!/bin/ksh<BR>PROGNAME=`basename
$0`<BR>VMQUERY=/var/tmp/$PROGNAME.$$.vmquery<BR>BPMEDIA=/var/tmp/$PROGNAME.$$.bpmedia<BR>
RET=/var/tmp/$PROGNAME.$$.ret</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face="Courier New" color=#0000ff
size=2>#Populate file of assigned media<BR>cp /dev/null $BPMEDIA<BR>for svr in
`bpstulist | awk '{print $3}' | sort -u`<BR>do<BR> bpmedialist -mlist -l
-h $svr >>$BPMEDIA<BR>done</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face="Courier New" color=#0000ff
size=2>#Retention levels<BR>bpretlevel -l | sort -n -k 2 >
$RET</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face="Courier New" color=#0000ff
size=2>#Volume database<BR>vmquery -a -w | awk 'NR>3 {print}'
>$VMQUERY</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face="Courier New" color=#0000ff
size=2>#Get current unix time
integer<BR>now=`seconds_since_epoch`</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face="Courier New" color=#0000ff
size=2>#Lots of counting<BR>echo "\n## General Data Tape Summary"<BR>awk
'$3!~/CLN/ {sum++} END {printf (" %20s: %4d\n","Total Data Tapes",sum)}'
$VMQUERY<BR>awk '$3!~/CLN/ && $8!~/-/ {sum++} END {printf ("
%20s:
%4d\n","Total Library Tapes",sum)}' $VMQUERY<BR>awk ' { if (int($15/8)%2)
{sum++}} END {printf (" %20s: %4d\n","Full Tapes",sum)}' $BPMEDIA<BR>awk
'$3!~/CLN/ && $20 ~ /^00\/00\/00/ {sum++} END {printf (" %20s:
%4d\n","Empty Tapes",sum)}' $VMQUERY<BR>awk ' { if (int($15/2)%2) {sum++}} END
{printf (" %20s: %4d\n","Suspended Tapes",sum)}' $BPMEDIA<BR>awk ' { if
(int($15)%2) {sum++}} END {printf (" %20s: %4d\n","Frozen
Tapes",sum)}' $BPMEDIA<BR>awk '$3~/CLN/ {sum++} END {printf (" %20s:
%4d\n","Total Cleaning Tapes",sum)}' $VMQUERY</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face="Courier New" color=#0000ff
size=2>echo "\n## Retentions"<BR>prev=0<BR>for retlvl in `awk '{print $1}'
$RET`<BR>do<BR> # count tapes in each retention level</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=606215519-09072003><FONT face=Arial><FONT size=2><FONT
color=#0000ff><FONT face="Courier New"> label=`awk '$1=='$retlvl' {if
($3~/infinit/) {print "Infinity"} else {print $3 " " $4}}' $RET`<BR>
offset=`awk '$1=="'$retlvl'" {print $2}' $RET`<BR> count=`awk 'BEGIN
{sum=0}<BR>
{if ('$now'+'$offset'>=$7)
{sum++}}<BR>
END {print sum}' $BPMEDIA`<BR> # if current count same as previous count
then skip-no tapes at this level<BR> if [ $count -ne $prev ]<BR>
then<BR> # Use awk function to get pretty
print<BR> echo "$label $count" |
\<BR> awk '{printf (" Expiring <= %2s %6s:
%4d\n",$1,$2,$3)}'<BR> fi<BR> prev=$count<BR>done<BR>rm $BPMEDIA
$RET $VMQUERY<BR>exit</FONT><BR></FONT></FONT></DIV>
<DIV></FONT></SPAN><SPAN class=606215519-09072003><FONT face=Arial
color=#0000ff
size=2>HTH -Mark</DIV>
<DIV><BR></DIV></FONT></SPAN>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Fabbro, Andrew P
[mailto:Fabbro.Andrew AT cnf DOT com]<BR><B>Sent:</B> Wednesday, July 09,
2003 1:37
PM<BR><B>To:</B> veritas-bu AT mailman.eng.auburn DOT edu<BR><B>Subject:</B>
[Veritas-bu] How to tell when all images on a tape will
expire?<BR><BR></FONT></DIV>
<P><FONT face=Arial size=2>Let's say I have tape #123456. I want to
know
when all images on the tape will expire and it will be scratched.
Actually, I have about 2,000 tapes and I want to run a report that says
"these
tapes will expire on these days". We do not mix retention levels but
there are many different pools with different retention levels. No, the
available_media script does not give this information - it</FONT></P>
<P><FONT face=Arial size=2>does not address the future.</FONT> </P>
<P><FONT face=Arial size=2>So...how can I determine that? Seems like a
basic bit of management info. bpimmedia will show me what images are on
the tape and when the expire, but parsing that out for 2,000 tapes and
processing it (compare dates) is not feasible. For one thing, I was
hoping to run this report daily and bpimmedia takes about 3 minutes per tape
and there aren't 6,000 minutes in a day ;)</FONT></P>
<P><FONT face="Courier New" size=2>-- </FONT><BR><FONT face="Courier New"
size=2> Drew Fabbro</FONT> <BR><FONT face="Courier New"
size=2> Manager, Unix Systems Group (USG)</FONT> <BR><FONT
face="Courier New" size=2> fabbro.andrew AT cnf DOT com</FONT> <BR><FONT
face="Courier New" size=2> Desk: 503.450.3374</FONT> <BR><FONT
face="Courier New" size=2> Cell: 503.701.0369</FONT>
</P><BR></BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C34658.2B799300--
|