---------- Forwarded message ----------
Date: Thu, 8 Feb 2001 15:51:47 -0800 (PST)
From: Eric Punsalan <epunsala>
To: Eric Punsalan <epunsala>
Subject: RE: [Veritas-bu] Using CAP/Mailslot and Netbackup 3.4
Here is a snippet of the code
Add this to the clam.pl script
#Add new media
print "\nThis option allows you to insert new/recycled
media into the library\n" ;
&Look_for_empties ;
&Insert_any_tapes ;
&Update_newmedia("s") ;
&Change_pool ;
print "\nThis option has completed.\n" ;
print "Press enter to return to the main menu." ;
$worthless_answer=<STDIN> ;
The insert any tapes already has much of the function to insert tapes
to/from the library using the vmchange command.
Add this to the nbu.pl script
print "Obtaining information about import/export slot contents...\n";
@mailslot_stack = ();
if ($robot_host eq "nbumaster") {
@return_mailslot = `echo "s i" | /usr/openv/volmgr/bin/tldtest -r
/dev/sg/c2t6l0 | /usr/bin/grep Barcode`;
}
else {
@return_mailslot = `/bin/rsh $robot_host -n 'echo "s i" |
/usr/openv/volmgr/bin/tldtest -r /dev/sg/c1t6l0 | /usr/bin/grep Barcode'`;
}
foreach $mailslot_line (@return_mailslot) {
($fieldname,$barcode) = split /=/, $mailslot_line , 2;
$barcode =~ s/^\s+//;
$barcode =~ s/\s+$//;
#print "barcode: |$barcode|";
push @mailslot_stack, $barcode;
}
sub Change_pool {
$assigned_pool = "3";
print "Changing volume pool to Scratch\n";
foreach $mmedia (@mailslot_stack) {
$status = system("/usr/openv/volmgr/bin/vmchange -M $master_server
-h $master_server -p $assigned_pool -m $mmedia");
if ($status == 0) {
print "mediaid $mmedia assigned to pool Scratch\n";
}
else {
print "ERROR: mediaid $mmedia not assigned to pool Scratch\n";
}
}
}
On Thu, 8 Feb 2001, Steve Quan wrote:
> Hi Eric,
>
> Thanks, that'll be great.
>
> /Steve
> ---
> On Thu, 8 Feb 2001, Eric Punsalan wrote:
> >
> > Steve,
> >
> > I have written a sub to the CLAM script that adds new/recycled tapes to
> > the current library. Let me know if you are interested, and I can email
> > you a copy of the code.
> >
> > -Eric
>
> <snip>
>
>
|