+ }
+ }
+}
+
+# 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++;
+ }
+ }