ADSM-L

Automatic checkin on a 3584?

2003-03-04 03:09:08
Subject: Automatic checkin on a 3584?
From: "Anthonijsz, Marcel M SITI-ITDGE13" <Marcel.Anthonijsz AT SHELL DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Tue, 4 Mar 2003 09:06:27 +0100
Dan,

Here's our perl script.. Easy as perl is most likely to be installed on your
*IX.
Not that this script is not 100% fool proof, but at that time it was a 10
min effort
and still works like a charm. And as is with any other perl pgm, there are
more ways...
This script now in the public domain...
Fill in your own OPERATORID and PASSWD....

#!/usr/bin/perl
#replies to checkin script

system("tput clear");
print "About to checkin scratch tapes, please wait ... \n";
sleep 3;
print "\n";
open(libraries, 'dsmadmc -commadelimited -id=OPERATORID -pass=PASSWD q libr
| grep SCSI |');

while (<libraries>) {
$l=$_; chomp($l);
  @record=split(/,/, $l);
  $libname=$record[0];
}

close libraries;

system("dsmadmc -id=OPERATORID -pass=PASSWD checkin libv $libname
search=bulk status=scratch >> /dev/null");
sleep 3;
print "\n";
open(libraries, 'dsmadmc -consolemode -commadelimited -id=OPERATORID
-pass=PASSWD |');
while (<libraries>) {
  $l=$_; chomp($l);
  @actlog=split(/ /, $l);
  if (($actlog[0] eq "ANR8373I") and ($actlog[9] eq "$libname")) {
    $replyid=$actlog[1];
    $replyid=~tr/://d;
    system("dsmadmc -id=OPERATORID -pass=PASSWD reply $replyid >
/dev/null");
  }
  if (($actlog[0] eq "ANR0987I") or ($actlog[0] eq "ANR0985I")) {
    print "$l\n";
    exit;
  }
}

---
Marcel Anthonijsz

marcel.anthonijsz!at!shell.com

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