--- amanda-2.4.5-20050711/server-src/amoverview.pl.in.last 2005-02-09 11:28:05.000000000 -0700 +++ amanda-2.4.5-20050711/server-src/amoverview.pl.in 2005-08-16 16:16:34.000000000 -0600 @@ -14,7 +14,7 @@ sub Usage { print STDERR < \$opt_config, 'hostwidth=i' => \$opt_hostwidth, 'diskwidth=i' => \$opt_diskwidth, 'skipmissed' => \$opt_skipmissed, + 'last' => \$opt_last, + 'num0' => \$opt_num0, + 'togo0' => \$opt_togo0, 'verbose' => \$opt_verbose) or Usage(); @@ -128,19 +134,51 @@ die "$0: error in closing `$amadmin $opt_config find|' pipe: $!\n"; # Process the status to arrive at a "last" status -for $host (sort keys %disks) { - for $disk (sort keys %{$disks{$host}}) { - $level{$host}{$disk}{"0000-LA-ST"} = ''; - for $date (sort keys %dates) { - if ($level{$host}{$disk}{$date} eq "E" - && $level{$host}{$disk}{"0000-LA-ST"} =~ /^\d/ ) { - $level{$host}{$disk}{"0000-LA-ST"} .= $level{$host}{$disk}{$date}; - } elsif ($level{$host}{$disk}{$date} eq "") { - $level{$host}{$disk}{"0000-LA-ST"} =~ s/E//; - } else { - $level{$host}{$disk}{"0000-LA-ST"} = $level{$host}{$disk}{$date}; +if ($opt_last) { + for $host (sort keys %disks) { + for $disk (sort keys %{$disks{$host}}) { + $level{$host}{$disk}{"0000-LA-ST"} = ''; + for $date (sort keys %dates) { + if ($level{$host}{$disk}{$date} eq "E" + && $level{$host}{$disk}{"0000-LA-ST"} =~ /^\d/ ) { + $level{$host}{$disk}{"0000-LA-ST"} .= $level{$host}{$disk}{$date}; + } elsif ($level{$host}{$disk}{$date} eq "") { + $level{$host}{$disk}{"0000-LA-ST"} =~ s/E//; + } else { + $level{$host}{$disk}{"0000-LA-ST"} = $level{$host}{$disk}{$date}; + } } - } + } + } +} + +# Number of level 0 backups +if ($opt_num0) { + for $host (sort keys %disks) { + for $disk (sort keys %{$disks{$host}}) { + $level{$host}{$disk}{'0000-NM-L0'} = 0; + for $date (sort keys %dates) { + if ($level{$host}{$disk}{$date} =~ /0/) { + $level{$host}{$disk}{'0000-NM-L0'} += 1; + } + } + } + } +} + +# Runs to the last level 0 +if ($opt_togo0) { + for $host (sort keys %disks) { + for $disk (sort keys %{$disks{$host}}) { + $level{$host}{$disk}{'0000-TO-GO'} = 0; + my $togo=0; + for $date (sort keys %dates) { + if ($level{$host}{$disk}{$date} =~ /0/) { + $level{$host}{$disk}{'0000-TO-GO'} = $togo; + } + $togo++; + } + } } } @@ -161,7 +199,13 @@ } #Add the "last" entry -$dates{"0000-LA-ST"}=1; +$dates{"0000-LA-ST"}=1 if ($opt_last); + +#Add the "Number of Level 0s" entry +$dates{"0000-NM-L0"}=1 if ($opt_num0); + +#Add the "Runs to go" entry +$dates{"0000-TO-GO"}=1 if ($opt_togo0); # make formats --- amanda-2.4.5-20050711/man/amoverview.8.last 2005-05-13 11:49:43.000000000 -0600 +++ amanda-2.4.5-20050711/man/amoverview.8 2005-08-16 16:13:38.000000000 -0600 @@ -24,7 +24,7 @@ .ad l .hy 0 .HP 11 -\fBamoverview\fR [[\-config]\ \fIconfig\fR] [\-hostwidth\ \fIwidth\fR] [\-diskwidth\ \fIwidth\fR] [\-skipmissed] [\-verbose] +\fBamoverview\fR [[\-config]\ \fIconfig\fR] [\-hostwidth\ \fIwidth\fR] [\-diskwidth\ \fIwidth\fR] [\-skipmissed] [\-last] [\-num0] [\-togo0] [\-verbose] .ad .hy @@ -55,6 +55,18 @@ Compacts the output by only printing stats for the days \fBAMANDA\fR actually ran\&. .TP +\fB\-last\fR +Outputs the last status of each disk at the start. Useful for long tapecycles and/or sparse reports\&. + +.TP +\fB\-num0\fR +Outputs the number of level 0 dumps for each disk\&. + +.TP +\fB\-togo0\fR +Outputs the number of runs until the last level 0 dump is overwritten\&. + +.TP \fB\-verbose\fR \fBAmoverview\fR can take a long while on large systems\&. This option reports intermediate steps while it is working\&.