ADSM-L

Re: Script to CHECKOUT multiples tapes on SCSI library

2001-12-10 17:35:03
Subject: Re: Script to CHECKOUT multiples tapes on SCSI library
From: "Taylor, David" <DTaylor AT WBMI DOT COM>
Date: Mon, 10 Dec 2001 16:31:08 -0600
Frequent submitter, and all-around great guy, Mark Stapleton helped with
this. (though he DOES still owe me a mug!)

We do this from within an AIX Korn-shell script.  This is basics of the
logic:

-----------------------------------
#  get a list of copypool tapes that are NOT offsite
#  get a list of copypool tapes that are NOT offsite
dsmadmc -id admin -pass=$TSMPWD "select volume_name from volumes where
stgpool_name-='COPYPOOL' and access <>'OFFSITE' "| sed '1,2d | grep -c "^
*$" | grep -v AND[0-9] > $CHECKOUTLIST

#  get a list of the DBB tapes
dsmadmc -id=admin -pass=$TSMPWD "select volume_name from volhistory where
type='BACKUPFULL'" | sed '1,2d' | grep -v "^ *$" | grep -v ANS[0-9] >
$TMPDBLIST

# compare the backup tapes to that currently known to be offsite
# to find the onsite DBB
cat $PHYSICALVAULTLIST | while read VOL_LABEL; do
   VAL=$VAL$VOL_LABEL\|
done
VAL=$VAL"garbage"
egrep -v $VAL $TMPDBLIST >> $CHECKOUTLIST

# change the status of the ones to be checked out and ccheck 'em out
cat $CHECKOUTLIST | while read VOL_LABEL; do
dsmadmc -id=admin -pass=$TSMPWD "upd vol $VOL_LABEL access=offsite" >
$CHECKOUTLOG 2> &1
dsmadmc -id=admin -pass=$TSMPWD "checkout libv <your lib> $VOL_LABEL
checklabel=no remove=bulk" >> $CHECKOUTLOG 2>&1
done
--------------------------------
-----Original Message-----