ADSM-L

Re: STK 9310 Eject Script

2003-03-25 07:45:41
Subject: Re: STK 9310 Eject Script
From: "Ford, Phillip" <phillip.ford AT SPCORP DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Tue, 25 Mar 2003 07:44:33 -0500
Here is my script


----------snip-------
#!/usr/bin/sh
#set -x

# file /var/operlib/adsm/remove_drm


# debug - 0 no debug   1-print  2-simulate
debug=0
lib=lib0

if [ $debug -gt 0 ]; then
   echo debug is on and set to $debug
   echo library to use is $lib
fi




cat /etc/adsm/adsm | read usr pw

CMD="dsmadmc -id=$usr -password=$pw"
CMD1="dsmadmc -id=$usr -password=$pw -comma "
$CMD "move drm * wherestate=mountable  tostate=vault remove=untileefull" >
/tmp/che
ckout_log
if [ $? -eq 0 ]; then
      RETRY=0
      sleep 30
      while true
      do
        $CMD q request > /tmp/checkout_ask
        grep ANR8322I /tmp/checkout_ask > /dev/null

        if [ $? -eq 0 ]; then
           RETRY=0
           grep ANR8322I /tmp/checkout_ask |grep "Remove LTO volume" |awk
'{print $
2}' > /tmp/checkout_reply
           COMMAND=`sed s/://g  /tmp/checkout_reply`
           $CMD "reply $COMMAND" > /dev/null
           rm /tmp/checkout_*
           sleep 30
        else

#          now check if move drm is still running - if not quit
           i=`$CMD1 "q proc " | /var/operlib/adsm/cleanhdrs | grep -c "MOVE
DRMEDIA
"`
           if [ "$i" = "0" ]; then
              rm /tmp/checkout_*
              break
           fi
           rm /tmp/checkout_*
           sleep 30

#           if (( $RETRY<30 )) ; then
#              RETRY=`expr $RETRY + 1`
#           else
#              break
#           fi
        fi
      done
fi
--------------------snip----------------

Hope that helps


--
Phillip Ford
Senior Software Specialist
Corporate Computer Center
Schering-Plough Corp.
(901) 320-4462
(901) 320-4856 FAX
phillip.ford AT spcorp DOT com





-----Original Message-----
From: Ben Chuang [mailto:bchuang AT CHUANG DOT ORG]
Sent: Monday, March 24, 2003 3:40 PM
To: ADSM-L AT VM.MARIST DOT EDU
Subject: STK 9310 Eject Script


I'm looking to see if anybody has written a script that they could share
that fixes the issue with having to reply to automatic ejects when using a
STK 9310 with TSM. Every time tapes are ejected, TSM expects a reply so it
knows that the tapes have actually been removed. This is fine for manual
checkouts, but I'd like to automate the replies when automatically ejecting
tapes. Rather than reinvent the wheel, I figured I see if anybody had
written a script that they could share with me.

I contacted Tivoli about this "feature" and they say that they have no plans
on changing the way this works.


*********************************************************************
This message and any attachments are solely for the intended recipient. If you 
are not the intended recipient, disclosure, copying, use or distribution of the 
information included in this message is prohibited -- Please immediately and 
permanently delete.

<Prev in Thread] Current Thread [Next in Thread>