[Veritas-bu] CLI for tape retensions.
2003-03-12 11:55:56
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_01C2E8B8.3FF60730
Content-Type: text/plain;
charset="iso-8859-1"
Tapes with an expiration of greater than two months will come from
"bpmedialist -mlist -l". Field 7 is the expiration date in Unix seconds.
Get the current time in unix seconds, (using PERL or a C program), subtract
the two & find a difference greater than two months.
For frozen tapes in the library:
Well, here's how to find frozen tapes:
bpmedialist -mlist -l | awk ' { if ( $15%2 ) {print $1} }'
...note, this is for one media-server environment, you have to loop through
all media servers if you have more than one (note "-h" option to
bpmedialist).
Here's the tapes in the library:
vmquery -w -a | awk 'NR>3 && $9!="-" {print $1}'
...now the trick is to cross-reference the lists...
#!/bin/sh
vmquery -w -a | awk 'NR>3 && $9!="-" {print $1}' >/tmp/TMPFILE.$$
for tape in `bpmedialist -mlist -l | awk ' { if ( $15%2 ) {print $1} }'`
do
if [ `grep -c "^${tape}$" /tmp/TMPFILE.$$` -gt 0 ]
then
echo $tape
fi
done
rm /tmp/TMPFILE.$$
exit
That's it. Hope this helps.
-Mark
-----Original Message-----
From: Shuster, James [mailto:jshuster AT etrade DOT com]
Sent: Tuesday, March 11, 2003 1:54 PM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] CLI for tape retensions.
Looking for a CLI to report
Tapes that have a retension of higher than 2 months.
Tapes that are still in the library and frozen.
_______________________________________________
Veritas-bu maillist - Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
------_=_NextPart_001_01C2E8B8.3FF60730
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: [Veritas-bu] CLI for tape retensions.</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>Tapes with an expiration of greater than two months =
will come from "bpmedialist -mlist -l". Field 7 is the =
expiration date in Unix seconds. Get the current time in unix =
seconds, (using PERL or a C program), subtract the two & find a =
difference greater than two months.</FONT></P>
<P><FONT SIZE=3D2>For frozen tapes in the library:</FONT>
</P>
<P><FONT SIZE=3D2>Well, here's how to find frozen tapes:</FONT>
</P>
<P><FONT SIZE=3D2> bpmedialist -mlist -l | awk ' { if ( $15%2 ) =
{print $1} }'</FONT>
</P>
<P><FONT SIZE=3D2>...note, this is for one media-server environment, =
you have to loop through all media servers if you have more than one =
(note "-h" option to bpmedialist).</FONT></P>
<BR>
<P><FONT SIZE=3D2>Here's the tapes in the library:</FONT>
</P>
<P><FONT SIZE=3D2> vmquery -w -a | awk 'NR>3 && =
$9!=3D"-" {print $1}' </FONT>
</P>
<P><FONT SIZE=3D2>...now the trick is to cross-reference the =
lists...</FONT>
</P>
<P><FONT SIZE=3D2>#!/bin/sh</FONT>
<BR><FONT SIZE=3D2>vmquery -w -a | awk 'NR>3 && =
$9!=3D"-" {print $1}' >/tmp/TMPFILE.$$</FONT>
<BR><FONT SIZE=3D2>for tape in `bpmedialist -mlist -l | awk ' { if ( =
$15%2 ) {print $1} }'`</FONT>
<BR><FONT SIZE=3D2>do</FONT>
<BR><FONT SIZE=3D2> if [ `grep -c "^${tape}$" =
/tmp/TMPFILE.$$` -gt 0 ]</FONT>
<BR><FONT SIZE=3D2> then</FONT>
<BR><FONT SIZE=3D2> echo $tape</FONT>
<BR><FONT SIZE=3D2> fi</FONT>
<BR><FONT SIZE=3D2>done</FONT>
<BR><FONT SIZE=3D2>rm /tmp/TMPFILE.$$</FONT>
<BR><FONT SIZE=3D2>exit</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>That's it. Hope this helps.</FONT>
<BR><FONT SIZE=3D2>-Mark</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Shuster, James [<A =
HREF=3D"mailto:jshuster AT etrade DOT com">mailto:jshuster AT etrade DOT
com</A>]</FON=
T>
<BR><FONT SIZE=3D2>Sent: Tuesday, March 11, 2003 1:54 PM</FONT>
<BR><FONT SIZE=3D2>To: veritas-bu AT mailman.eng.auburn DOT edu</FONT>
<BR><FONT SIZE=3D2>Subject: [Veritas-bu] CLI for tape =
retensions.</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Looking for a CLI to report</FONT>
<BR><FONT SIZE=3D2>Tapes that have a retension of higher than 2 =
months.</FONT>
<BR><FONT SIZE=3D2>Tapes that are still in the library and =
frozen.</FONT>
<BR><FONT =
SIZE=3D2>_______________________________________________</FONT>
<BR><FONT SIZE=3D2>Veritas-bu maillist - =
Veritas-bu AT mailman.eng.auburn DOT edu</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu" =
TARGET=3D"_blank">http://mailman.eng.auburn.edu/mailman/listinfo/veritas=
-bu</A></FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C2E8B8.3FF60730--
|
|
|