ADSM-L

Re: Automate Tape checkout

2000-05-11 10:12:18
Subject: Re: Automate Tape checkout
From: Mark Adams <mark_adams AT CSGSYSTEMS DOT COM>
Date: Thu, 11 May 2000 09:12:18 -0500
Here is a script that I wrote a long time ago.
You are welcome to try it. It will check out a particular tape, do your
reply
and mark it unavailable. It could be modified to meet your needs.

****************************************************************************
*******************
****************************************************************************
*******************
if [ $# = "0" ]
then
  echo "\n\nUSAGE: chkout_dat_tp [LIBVOLUME]"
  echo "\n      EXAMPLE: chkout_dat_tp VOL005\n\n"
  exit 1
fi
TMPFILE=/tmp/adsmact.log
ADSMCMD='dsmadmc -id=userid -password=xxxxxxx'
${ADSMCMD} checkout libvolume LIBRARYNAME $1 checklabel=yes
if [ $? != 0 ]
then
     echo "There was a problem with the tape drive -- Check the activity log
to find the problem"
     exit 1
fi

clear
echo "Please wait ---- Checking activity log."

############################################################################
##
### WATCH ACTIVITY LOG TO OBTAIN REPLY NUMBER
############################################################################
##
while true
do
    CTR=0
    ${ADSMCMD} query actlog begintime=now-0:01 endtime=now msgno=8322 >
${TMPFILE}
    if [ $? = 0 ]
    then
      break
    fi
    if [ ${CTR} = 0 ]
    then
         ${ADSMCMD} query actlog begintime=now-0:01 endtime=now msgno=8336 >
${TMPFILE}
         if [ $? = 0 ]
         then
              echo "Verifying label of 3570 volume $1"
              CTR=1
         fi
    fi
    sleep 30
done

REPLY=`grep ANR8322I ${TMPFILE} | awk '{print $4}' | cut -c1-3`
${ADSMCMD} reply ${REPLY} >> ${TMPFILE}
if [ $? != 0 ]
then
     echo "There was a problem with the reply -- Check the activity log to
find the problem"
     cat ${TMPFILE}
     exit 2
fi

############################################################################
##
### WATCH ACTIVITY LOG TO SEE IF CHECKOUT WAS SUCCESSFUL
############################################################################
##
while true
do
    RSP=''
    ${ADSMCMD} query actlog begintime=now-0:01 endtime=now msgno=8438 >
${TMPFILE}
    if [ $? = 0 ]
    then
        echo "\nCheckout of volume $1 was successful"
        echo "\nRemove 3570 volume $1 from entry/exit port.\n\nPress enter
to continue."
        read RSP
        break
    fi
    ${ADSMCMD} query actlog begintime=now-0:01 endtime=now msgno=8437 >
${TMPFILE}
    if [ $? = 0 ]
    then
      echo "Checkin of libvolume $1 was unsuccessful"
      cat ${TMPFILE}
      exit 3
    fi
    sleep 30
done


############################################################################
##
### UPDATE VOLUME TO MAKE IT UNAVAILABLE TO MOUNT
############################################################################
##

echo "Updating volume $1 to unavailable"
${ADSMCMD} update volume $1 access=unavailable
if [ $? != 0 ]
then
     echo "There was a problem with the update -- Check the activity log to
find the problem"
     exit 4
fi

echo "Checkout and update process for volume $1 is now complete"
****************************************************************************
*********************
****************************************************************************
*********************

Mark A. Adams
Systems Programmer
CSG SYSTEMS, INC.
(402) 963-8237


> -----Original Message-----
> From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU]On Behalf Of
> Alyn Bush
> Sent: Tuesday, May 09, 2000 8:15 AM
> To: ADSM-L AT VM.MARIST DOT EDU
> Subject: Automate Tape checkout
>
>
> I'm trying to write a script to automate tape checkout and not to
> do one by
> one by typing REPLY and then
> Request Number.  Anybody has already done it.
>
> I am on IBM RS-6000/ S70 AIX 4.3.1,  and ADSM 3,1,2.4  and Tape drive is
> 3570
>
> Thanks,
> Alyn
>
> ______________________________________________
> FREE Personalized Email at Mail.com
> Sign up at http://www.mail.com/?sr=signup
<Prev in Thread] Current Thread [Next in Thread>