projects
/
debian
/
amanda
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 2.5.2p1
[debian/amanda]
/
server-src
/
amtoc.pl.in
diff --git
a/server-src/amtoc.pl.in
b/server-src/amtoc.pl.in
index 0e6a8d7da340e425acb84e208e5cada365394c18..79d0757a4f20bac862f6cbcad055430e66c56982 100644
(file)
--- a/
server-src/amtoc.pl.in
+++ b/
server-src/amtoc.pl.in
@@
-34,7
+34,7
@@
#--------------------------------------------------------
#--------------------------------------------------------
-sub pr($$$$$$) {
+sub pr($$$$$$
$
) {
# you can update these proc if you want another formating
# format: filenumber host:part date level size
# If you use tabular option, modifie the format at the end of the code
# you can update these proc if you want another formating
# format: filenumber host:part date level size
# If you use tabular option, modifie the format at the end of the code
@@
-44,9
+44,10
@@
sub pr($$$$$$) {
$dt=$_[3];
$lvl=$_[4];
$sz=$_[5];
$dt=$_[3];
$lvl=$_[4];
$sz=$_[5];
+ $ch=$_[6];
write($OF);
} else {
write($OF);
} else {
- print $OF "$_[0] $_[1]:$_[2] $_[3] $_[4] $_[5]\n";
+ print $OF "$_[0] $_[1]:$_[2] $_[3] $_[4] $_[5]
$_[6]
\n";
}
}
#--------------------------------------------------------
}
}
#--------------------------------------------------------
@@
-128,6
+129,9
@@
sub init() {
&init;
&init;
+delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
+$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
+
$dir=$logfile;
$dir =~ s/[^\/]*$//;
$dir=$logfile;
$dir =~ s/[^\/]*$//;
@@
-145,26
+149,27
@@
while ( <$IF> ) {
}
if ( /^SUCCESS dumper (\S+) (\S+)/ ) {
$host = $1;
}
if ( /^SUCCESS dumper (\S+) (\S+)/ ) {
$host = $1;
- $
part
= $2;
+ $
disk
= $2;
$line =~ /orig-kb (\d+)/;
$line =~ /orig-kb (\d+)/;
- $osize{$host}{$
part
} = $1;
- $tot_or_size += $osize{$host}{$
part
};
- $fail{$host}{$
part
} = 0;
+ $osize{$host}{$
disk
} = $1;
+ $tot_or_size += $osize{$host}{$
disk
};
+ $fail{$host}{$
disk
} = 0;
next;
}
if ( /^START amflush/ ) {
$flash_mode = 1;
next;
}
next;
}
if ( /^START amflush/ ) {
$flash_mode = 1;
next;
}
- if ( ! /^([A-Z]+) taper (\S+) (\S+) (\S+) (\S+)/) { next;}
+ if ( ! /^([A-Z]+) taper (\S+) (\S+) (\S+) (\S+)
(\S+)
/) { next;}
# $_ = $1;
$host = $2;
# $_ = $1;
$host = $2;
- $
part
= $3;
+ $
disk
= $3;
$date = $4;
$date = $4;
- $level = $5;
+ $chunk = $5;
+ $level = $6;
switch: {
/START taper/ && do {
switch: {
/START taper/ && do {
- $tocfilename=&tfn($
level
) if ($#subs >= 0);
+ $tocfilename=&tfn($
chunk
) if ($#subs >= 0);
if (!$tocfilename || ($tocfilename eq '-')) {$OF=STDOUT;}
else {
die ("Cannot open tocfile $tocfilename") unless open(OF,">$tocfilename");
if (!$tocfilename || ($tocfilename eq '-')) {$OF=STDOUT;}
else {
die ("Cannot open tocfile $tocfilename") unless open(OF,">$tocfilename");
@@
-183,23
+188,34
@@
while ( <$IF> ) {
$filenumber=0;
$filenumber=0;
- &pr("#","Server","/partition","date", "level","size[Kb]");
- &pr("$filenumber","$
level","","$part
","-","-");
+ &pr("#","Server","/partition","date", "level","size[Kb]"
,"part"
);
+ &pr("$filenumber","$
chunk","","$disk","-
","-","-");
last switch; };
last switch; };
- /SUCCESS taper/ && do {
- $line =~ / kb (\d+) /;
- if ( $fail{$host}{$part} ) {
- &pr("$filenumber","${host}","${part}","${date}","${level}","FAIL");
+ /^(?:SUCCESS|CHUNK) taper/ && do {
+ if(/SUCCESS/){
+ $level = $chunk;
+ $chunk = "-";
+ }
+ $mysize = 0;
+ if(/ kb (\d+) /){
+ $mysize = $1;
+ }
+ if ( $fail{$host}{$disk} ) {
+ &pr("$filenumber","${host}","${disk}","${date}","${level}","FAIL","${chunk}");
} else {
if (defined($flash_mode)) {
} else {
if (defined($flash_mode)) {
- &pr("$filenumber","${host}","${
part}","${date}","${level}","$1
");
+ &pr("$filenumber","${host}","${
disk}","${date}","${level}","$mysize","${chunk}
");
} else {
} else {
- if (defined($osize{$host}{$
part})
) {
- &pr("$filenumber","${host}","${
part}","${date}","${level}","$osize{$host}{$part
}");
+ if (defined($osize{$host}{$
disk}) && !/^CHUNK/
) {
+ &pr("$filenumber","${host}","${
disk}","${date}","${level}","$osize{$host}{$disk}","${chunk
}");
} else {
} else {
+ $note = "";
+ if(!/^CHUNK/){
# this case should never happend:
# this case should never happend:
- &pr("$filenumber","${host}","${part}","${date}","${level}","*$1");
$strange=1;
$strange=1;
+ $note = "*";
+ }
+ &pr("$filenumber","${host}","${disk}","${date}","${level}","$note$mysize","${chunk}");
}
}
}
}
}
}
@@
-212,14
+228,14
@@
while ( <$IF> ) {
$size = $1;
$line =~ / fm (\d+) /;
print "\n\n" if ($vwspace);
$size = $1;
$line =~ / fm (\d+) /;
print "\n\n" if ($vwspace);
- &pr("$1","total","on_tape","-","-","$size");
+ &pr("$1","total","on_tape","-","-","$size"
,"-"
);
if (defined($flash_mode)) {
if (defined($flash_mode)) {
- &pr("$1","total","origin","-","not","available");
+ &pr("$1","total","origin","-","not","available"
,"-"
);
} else {
} else {
- &pr("$1","total","origin","-","-","$tot_or_size");
+ &pr("$1","total","origin","-","-","$tot_or_size"
,"-"
);
}
if (defined($strange)) {
}
if (defined($strange)) {
- &pr("*","size","on_tape","-","-","-");
+ &pr("*","size","on_tape","-","-","-"
,"-"
);
}
last switch; };
/FAIL taper/ && do { next; };
}
last switch; };
/FAIL taper/ && do { next; };
@@
-236,6
+252,6
@@
$fnbr,$hstprt,$dt,$lvl,$sz
.
format STDOUT =
.
format STDOUT =
-@>> @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<< @>> @>>>>>>>>
-$fnbr,$hstprt,$dt,$lvl,$sz
+@>> @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<< @>> @>>>>>>>>
@>>>
+$fnbr,$hstprt,$dt,$lvl,$sz
,$ch
.
.