This is a multipart message in MIME format.
--=_alternative 007302AF86256D5F_=
Content-Type: text/plain; charset="us-ascii"
and since bpmedialist shows this info, as Mark mentioned, and it is also
used in the available_media script, you can easily add this as a new
column to a customized version of the available_media script if you want.
I have added a column on mine for last write date and expiration date and
also allow options to be passed that will make the report only report on a
specific library or specific volume pool. I use the report to feed a
script that determines what tapes should get ejected (based on status, KB
written, last write date and expiration date) and then ejects them for me.
- Scott
"Donaldson, Mark" <Mark.Donaldson AT experianems DOT com>
Sent by: veritas-bu-admin AT mailman.eng.auburn DOT edu
07/09/2003 03:24 PM
To: "'Fabbro, Andrew P'" <Fabbro.Andrew AT cnf DOT com>,
veritas-bu AT mailman.eng.auburn DOT edu
cc:
Subject: RE: [Veritas-bu] How to tell when all images on a tape
will expir e?
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
--=_alternative 007302AF86256D5F_=
Content-Type: text/html; charset="us-ascii"
<br><font size=2 face="Arial">and since bpmedialist shows this info, as Mark
mentioned, and it is also used in the available_media script, you can easily
add this as a new column to a customized version of the available_media script
if you want.</font>
<br>
<br><font size=2 face="Arial">I have added a column on mine for last write date
and expiration date and also allow options to be passed that will make the
report only report on a specific library or specific volume pool. I use
the report to feed a script that determines what tapes should get ejected
(based on status, KB written, last write date and expiration date) and then
ejects them for me.</font>
<br>
<br>
<br><font size=2 face="Arial">- Scott</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>"Donaldson, Mark"
<Mark.Donaldson AT experianems DOT com></b></font>
<br><font size=1 face="sans-serif">Sent by: veritas-bu-admin AT
mailman.eng.auburn DOT edu</font>
<p><font size=1 face="sans-serif">07/09/2003 03:24 PM</font>
<br>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To:
"'Fabbro, Andrew P'" <Fabbro.Andrew AT cnf DOT
com>, veritas-bu AT mailman.eng.auburn DOT edu</font>
<br><font size=1 face="sans-serif"> cc:
</font>
<br><font size=1 face="sans-serif"> Subject:
RE: [Veritas-bu] How to tell when all images on a tape will
expir e?</font></table>
<br>
<br>
<br><font size=2 color=blue face="Arial">You can get this from
"bpmedialist" pretty easily:</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Courier New">$ bpmedialist -U<br>
Server Host = backup0</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Courier New"> 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 <b><i>06/03/2003
15:23 </i></b> N/A
EXPIRED FROZEN</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Courier New">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>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Courier New">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>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Arial">The expiration date is where I
highlighted it.</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Arial">A little awk parsing will turn this
into a one-liner if the form isn't very good for you.</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Arial">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>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Courier New">## 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>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Courier New">## 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</font>
<br><font size=2 color=blue face="Arial">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>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Courier New">#!/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>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Courier New">#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>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Courier New">#Retention levels<br>
bpretlevel -l | sort -n -k 2 > $RET</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Courier New">#Volume database<br>
vmquery -a -w | awk 'NR>3 {print}' >$VMQUERY</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Courier New">#Get current unix time
integer<br>
now=`seconds_since_epoch`</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Courier New">#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>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Courier New">echo "\n##
Retentions"<br>
prev=0<br>
for retlvl in `awk '{print $1}' $RET`<br>
do<br>
# count tapes in each retention level</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue 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 size=2 color=blue face="Arial">HTH -Mark</font>
<br>
<br><font size=2 face="Tahoma">-----Original Message-----<b><br>
From:</b> Fabbro, Andrew P [mailto:Fabbro.Andrew AT cnf DOT com]<b><br>
Sent:</b> Wednesday, July 09, 2003 1:37 PM<b><br>
To:</b> veritas-bu AT mailman.eng.auburn DOT edu<b><br>
Subject:</b> [Veritas-bu] How to tell when all images on a tape will expire?<br>
</font>
<p><font size=2 face="Arial">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><font size=2 face="Arial">does not address the future.</font><font size=3
face="Times New Roman"> </font>
<p><font size=2 face="Arial">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><font size=2 face="Courier New">-- <br>
Drew Fabbro</font><font size=3 face="Times New Roman"> </font><font size=2
face="Courier New"><br>
Manager, Unix Systems Group (USG)</font><font size=3 face="Times New Roman">
</font><font size=2 face="Courier New"><br>
fabbro.andrew AT cnf DOT com</font><font size=3 face="Times New Roman">
</font><font size=2 face="Courier New"><br>
Desk: 503.450.3374</font><font size=3 face="Times New Roman"> </font><font
size=2 face="Courier New"><br>
Cell: 503.701.0369</font><font size=3 face="Times New Roman"> </font>
<p>
<p>
<p>
--=_alternative 007302AF86256D5F_=--
|