X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=server-src%2Famoverview.pl.in;fp=server-src%2Famoverview.pl.in;h=07fdb975d3a4b0a251711596e02f18aad1f2e57b;hb=34197d9f46a5f4e944378cbb65fca32ee0eec7b9;hp=9f4ce99b71864faa3abe4fe4321d6e62d8cb81c4;hpb=71325c297e0436e9930a3e129a26696e78c27f62;p=debian%2Famanda diff --git a/server-src/amoverview.pl.in b/server-src/amoverview.pl.in index 9f4ce99..07fdb97 100644 --- a/server-src/amoverview.pl.in +++ b/server-src/amoverview.pl.in @@ -13,6 +13,9 @@ use Text::ParseWords; use Carp; use POSIX; +delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'}; +$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin"; + sub Usage { print STDERR <; while (<$fh>) { -print "'$_'\n"; chomp; next if /found Amanda directory/; next if /skipping cruft directory/; next if /skip-incr/; - ($date, $host, $disk, $level, $tape, $file, $part, $status) = quotewords(" ", 0, $_); + + ($date, $time, $host, $disk, $level, $tape, $file, $part, $status) = shellwords($_); + next if $date eq 'date'; next if $date eq 'Warning:'; next if $date eq 'Scanning'; next if $date eq ""; + + if($time !~/^\d\d:\d\d:\d\d$/) { + $status = $part; + $part = $file; + $file = $tape; + $tape = $level; + $level = $disk; + $disk = $host; + $host = $time; + } + if ($date =~ /^\d\d\d\d-\d\d-\d\d$/) { - defined($level{$host}{$disk}{$date}) or - $level{$host}{$disk}{$date} = ''; - $level{$host}{$disk}{$date} .= ($status eq 'OK') ? $level : 'E'; - $dates{$date}++; + if(defined $disks{$host}{$disk}) { + defined($level{$host}{$disk}{$date}) or + $level{$host}{$disk}{$date} = ''; + $level{$host}{$disk}{$date} .= ($status eq 'OK') ? $level : 'E'; + $dates{$date}++; + } } else { print "bad date $date in $_\n";