Here is a basic rundown of what the script does.
- On each library client DRM checks the tapes out with a REMOVE=NO option and creates a file with a list of the tapes.
- On the library manager the tapes are checked back into the library.
- The Library manager then checks every library clients DRM tapes out.
move drm * so=dbb wherestate=mo tostate=vault remove=no CMD=&VOL CMDFILE=/usr/tivoli/tsm/client/ba/bin/Vol_List APPEND=YES WAIT=YES
move drm * so=dbb wherestate=vaultr tostate=onsiter
=-=-=-=-= Below Starts Checkout Script =-=-=-=-=
#!/bin/ksh
cd /usr/tivoli/tsm/client/ba/bin
OFFSITE=/usr/tivoli/tsm/client/ba/bin/OFFSITE/offsite.txt
RETRIEVE=/usr/tivoli/tsm/client/ba/bin/OFFSITE/retrieve.txt
ADSMID=`cat /usr/local/scripts/ADSMID`
ADSMPASS=`cat /usr/local/scripts/ADSMPASS`
I=2
cp $OFFSITE "$OFFSITE.BAK"
cp $RETRIEVE "$RETRIEVE.BAK"
cp /usr/tivoli/tsm/client/ba/bin/Vol_List /usr/tivoli/tsm/client/ba/bin/Vol_List.bak
cat /dev/null > /usr/tivoli/tsm/client/ba/bin/Vol_List
printf "Use this list to determine tapes that are to go offsite report any discrepancies to the Recovery Services Team.\n\n" > $OFFSITE
printf " \n\n" >> $OFFSITE
printf "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\n" >> $OFFSITE
printf " Tapes to be sent offsite\n\n" >> $OFFSITE
printf " Current as of: `date`\n\n" >> $OFFSITE
printf "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\n" >> $OFFSITE
printf "Use this list to determine tapes that are to come back onsite from Iron Mountain for reuse. Report any discrepancies to the Recovery Service Team.\n\n" > $RETRIEVE
printf " \n\n" >> $RETRIEVE
printf "********************************************************\n\n" >> $RETRIEVE
printf " Tapes to be brought back onsite from Iron Mountain\n" >> $RETRIEVE
printf " and placed back into TSM library for scratch.\n\n" >> $RETRIEVE
printf " Current as of: `date`\n\n" >> $RETRIEVE
printf "********************************************************\n\n" >> $RETRIEVE
while [ $I -lt 8 ]
do
S=TSMSERV-$I
dsmadmc -id=$ADSMID -password=$ADSMPASS -servername=$S -dataonly=yes "select volume_name from drmedia where state='MOUNTABLE' " grep L[0-3] >> $OFFSITE
dsmadmc -id=$ADSMID -password=$ADSMPASS -servername=$S -dataonly=yes "select volume_name from drmedia where state='VAULTRETRIEVE' " grep L[0-3] >> $RETRIEVE
dsmadmc -id=$ADSMID -password=$ADSMPASS -servername=$S 'macro move_drmedia.mac'
sleep 120
I=$(( $I + 1 ))
done
dsmadmc -id=$ADSMID -password=$ADSMPASS -servername=TSMSERV-1 'CHECKIN LIBVOL TSMLIB search=yes stat=private checklabel=no vollist=FILE:/usr/tivoli/tsm/client/ba/bin/Vol_List'
sleep 180
dsmadmc -id=$ADSMID -password=$ADSMPASS -servername=TSMSERV-1 'CHECKOUT LIBVOL TSMLIB vollist=FILE:/usr/tivoli/tsm/client/ba/bin/Vol_List'
mail -s "TDC Daily Tape Checkout" $HN tape_rpt < $OFFSITE
mail -s "TDC Daily Tape Return" $HN tape_rpt < $RETRIEVE
I'm currently setting up the DRM scripts for the checkout from an ACSLS library that is used by several TSM servers. Your post is reallay helpfull for this issue.
ReplyDeleteHowever I'm wondering how do you do the checkin later on, more specific how do you set the correct owner of the tapes?
The copy storage pool tapes still have a status COURIERRETRIEVE when they are being checked in. I change the status to ONSITERETRIEVE afterwards. This makes it's easy to find tapes that should be onsite already but were somehow forgotten by the vaulting company.
Could you post your checkin scripts too? Or do you skip the state COURIERRETRIEVE and change the status immediately to ONSITERETRIEVE. Then the tapes become scratch again.
Looking forward for an update!
Kurt
Kurt,
ReplyDeleteI skip the courier retrieve and go straight to onsiteretieve. Either way should be fine, but I never tried checking in a tape as scratch when in courierretieve state, does TSM allow it to be checked in as scratch?