1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#!/usr/local/bin/perl -w
use blib;
use strict;
use AFS::BOS;
my ($server, $cellname, $logfile, $bos);
die "Usage: $0 server [cell] log_file_name \n" if $#ARGV < 1;
$server = shift;
$cellname = shift if $#ARGV == 2;
$logfile = shift;
if ($cellname) { $bos = AFS::BOS->new($server, 0, 0, $cellname); }
else { $bos = AFS::BOS->new($server); }
print "Error Code: $AFS::CODE\n" if ($AFS::CODE);
print "Fetching log file \'$logfile\' ...\n";
my @log = $bos->getlog($logfile);
print "Error Code: $AFS::CODE\n" if ($AFS::CODE);
print join('', @log);
$bos->DESTROY;
|