Re: Auto reply to request
2001-02-21 11:49:33
Here is a script that I wrote some time ago that does a auto-reply.
You could try and work this into the way you are presently doing it.
You may have to make some modifications to fit your needs.
Mark Adams
****************************************************************************
*
TMPFILE=/tmp/adsmact.log
ADSMCMD='dsmadmc -id=user -password=password'
#${ADSMCMD} checkin libvolume OMASPCTAPLIB0 $1 checklabel=yes status=scratch
${ADSMCMD} LABEL libvolume omaspctaplib0 search=bulk labelsource=barcode
checkin=scratch overwrite=yes
if [ $? != 0 ]
then
echo "There was a problem with the tape drive -- Check the activity log
to find the problem"
exit 1
fi
############################################################################
##
### WATCH ACTIVITY LOG TO OBTAIN REPLY NUMBER
############################################################################
##
clear
echo "PLEASE WAIT ---- Checking activity log."
while true
do
${ADSMCMD} query actlog begintime=now-0:01 endtime=now msgno=8373 >
${TMPFILE}
if [ $? = 0 ]
then
break
fi
sleep 30
done
REPLY=`grep ANR8373I ${TMPFILE} | awk '{print $4}' | cut -c1-3`
${ADSMCMD} reply ${REPLY}
if [ $? != 0 ]
then
echo "There was a problem with the reply -- Check the activity log to
find the problem"
exit 2
fi
############################################################################
##
### WATCH ACTIVITY LOG TO SEE IF CHECKIN WAS SUCCESSFUL
############################################################################
##
while true
do
clear
echo "Checking activity log."
${ADSMCMD} query actlog begintime=now-0:01 endtime=now msgno=8810 >
${TMPFILE}
if [ $? = 0 ]
then
cat ${TMPFILE}
echo "Checking activity log for a succesful check in."
while true
do
${ADSMCMD} query actlog begintime=now-0:01 endtime=now msgno=8427 >
${TMPFILE}
if [ $? = 0 ]
then
cat ${TMPFILE}
echo "Checkin of libvolume $1 was unsuccessful"
exit 0
fi
done
break
fi
sleep 30
done
*************************************************************************
|
|
|