#!/bin/perl $ID='drm'; $PASS='drm'; $VERBOSE=0; $RETRIES=10; $SLEEPTIME=120; sub check_in { my ($arg) = @_; @out=`C:\\Program Files\\Tivoli\\TSM\server\\tsmdiag\\dsmadmc -id=$ID -pass=$PASS "checkin libvol i500 search=bulk checklabel=barcode status=$arg"`; if ($VERBOSE) { print @out; } #look for idle status $match=1; $trycnt=1; #loop for x number of times if robot is busy or there is no req while ($trycnt<$RETRIES) { sleep 10; $out=`dsmadmc -id=$ID -pass=$PASS "q req"`; if ($VERBOSE) { print @out; } $trycnt++; if ($out=~m/ANR8373I /) { $trycnt=$RETRIES; } else { print "Robot busy - sleeping for $SLEEPTIME secs\n"; sleep $SLEEPTIME; } }