Networker

Re: [Networker] Problem with depositing tapes

2002-08-29 09:47:44
Subject: Re: [Networker] Problem with depositing tapes
From: Stan Horwitz <stan AT TEMPLE DOT EDU>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Thu, 29 Aug 2002 09:50:45 -0400
On Thu, 29 Aug 2002, Rymwid, Peter wrote:

> I'll take it.
> Glory to you.

The script I wrote follows:

#!/usr/local/bin/perl -w
#
# Author:  Stan Horwitz  stan AT temple DOT edu
# Organization:  Temple University
# Date:  August 28, 2002
# Purpose: To deposit tapes into a library

# This next line contains the name of the jukebox.
# Change the "xxxx" to the name of your tape library.
$JUKEBOX = "xxxx";

# This next line contains the path to the NetWorker binaries.
$NSRPATH = "/usr/opt/networker/bin/";

print "Building list of empty slots for $JUKEBOX.\n";

$index = $NSRPATH."nsrjb -C -j $JUKEBOX ".' | grep ":        " > 
/tmp/aitempties.data';

system($index);

open EMPTYLIST, "</tmp/aitempties.data";
$slots = "";

while (defined($buffer = <EMPTYLIST>))
{
   $i = index($buffer, ":") - 3;
   $temp = " -S ".substr($buffer, $i, 3);
   $slots = $slots." ".$temp;
}

$deposit = $NSRPATH."nsrjb -d -j ".$JUKEBOX.$slots."\n";
print "Issuing the command:\n";
print $deposit."\n\n\n";
system($deposit);

print "After the tapes are depositted, you should issue the command:\n";
$inventory = $NSRPATH."nsrjb -Iv -j ".$JUKEBOX.$slots."\n\n";
print $inventory;
print "when at least one AIT tape drive is available.\n\n";

system("/usr/bin/rm /tmp/aitempties.data");

exit;

--
Note: To sign off this list, send a "signoff" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=