ADSM-L

Re: Comparing results from Q LIBV against Q VOL looking for percent u tilized tapes outside of library

2001-06-29 11:26:43
Subject: Re: Comparing results from Q LIBV against Q VOL looking for percent u tilized tapes outside of library
From: Lindsay Morris <lmorris AT SERVERGRAPH DOT COM>
Date: Fri, 29 Jun 2001 11:26:58 -0400
If David's answer didn't help you, here's a shell script that you can use as
a model.

(it's an old script - the usual caveats apply...)

The basic trick is to make two sorted lists of tapes, then use "comm" to
compare them.
"comm" is a great unix filter most people don't use - try "man comm" to read
about it.

Good luck...


#!/bin/ksh
# Sometimes a drive error will cause a perfectly good tape to be
# "marked as private to prevent re-access".
# sometimes errant scripts or people can leave scratch tapes in the library
# without having checked them in.

libs=`dsmadmc -id=adsm -pas=adsm -tabd q libr | cleanhdrs | awk '{print $1}'
`
dsmadmc -id=adsm -pas=adsm -tabd q vol | cleanhdrs | awk '{print $1}' | sort
>/tmp/findscr$$.vol
for i in $libs
do
        dsmadmc -id=adsm -pas=adsm -tabd q libvol | cleanhdrs | awk '{print
$2}' | sort >/tmp/findscr$$.libv
        comm -23 /tmp/findscr$$.libv /tmp/findscr$$.vol | awk '{print
"update libv $i $1"}' /tmp/findscr$$.mac
        # uncomment if you want it to really do anything.  Otherwise just look 
at
/tmp/findscr$$.mac.
      # dsmadmc -id=admin -pas=`cat /.ap` -itemcommit macro
/tmp/findscr$$.mac
done



> -----Original Message-----
> From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU]On Behalf Of
> Lu Ann Mezera
> Sent: Friday, June 29, 2001 11:03 AM
> To: ADSM-L AT VM.MARIST DOT EDU
> Subject: Comparing results from Q LIBV against Q VOL looking for percent
> u tilized tapes outside of library
>
>
> We are running TSM 4.1 and have a MagStar 3575 tape library.
> Unfortunately,
> we have had to dismount many of our private volume tapes due to increasing
> storage needs (which will be resolved with the install of an
> additional tape
> library next month).  It seems like the space reclamation process doesn't
> ask for all of these dismounted private tapes after a certain time.
>
> I would like to run a query of all tapes that the library knows
> about to see
> the volumes that are below the threshold I want to have
> reclaimed.  I would
> then like to compare these volumes to what is actually mounted in the
> library.  We have been doing manual comparisons for the last few weeks and
> this is very time consuming.  I am thinking we could do a SQL select
> statement but I don't know what the syntax would be.
>
> Basically, I want to do a Q VOLUME and look for any tapes that
> are below 40%
> utilized and then compare the results to a Q LIBV 3575LIB
> command.  If I get
> a hit in both queries, I want to know the tape number.  Any suggestions?
>
> Thanks for your help.
>
> Lu Ann Mezera
> Data Center Supervisor
> Lab Safety Supply
> 608-757-4909
> 608-757-4652 Fax
> E-mail: l.mezera AT labsafety DOT com
> www.labsafety.com
>
<Prev in Thread] Current Thread [Next in Thread>