push(@rmdays, $d);
}
} else {
- # Remove obsolte days when we are in binary mode
+ # Remove obsolete days when we are in binary mode
# with noreport - there's no week-N directory
- if ("$y$weekNumber" lt $limit) {
+ my $diff_day = $retention * 7 * 86400;
+ my $oldday = POSIX::strftime("%s", 1,1,1,$d,$m-1,$y-1900);
+ my $lastday = $oldday;
+ if (($saved_last_line{datetime} =~ /^(\d+)\-(\d+)\-(\d+) /) ||
+ ($pgb_saved_last_line{datetime} =~ /^(\d+)\-(\d+)\-(\d+) /)) {
+ $lastday = POSIX::strftime("%s", 1,1,1,$3,$2-1,$1-1900);
+ }
+ if (($lastday - $oldday) > $diff_day) {
&logmsg('DEBUG', "Removing obsolete directory $outdir/$y/$m/$d");
&cleanup_directory("$outdir/$y/$m/$d", 1);
push(@rmdays, $d);
if ($has_exclusion >= 0) {
# Log line matches the excluded regex
- my $ef = 0;
- map { $ef = 1, last if ($line =~ /$_/is); } @exclude_line;
- next if ($ef);
+ map { next if ($line =~ /$_/is); } @exclude_line;
}
chomp($line);
if ($has_exclusion >= 0) {
# Log line matches the excluded regex
- my $ef = 0;
- map { $ef = 1, last if ($line =~ /$_/is); } @exclude_line;
- next if ($ef);
+ map { next if ($line =~ /$_/is); } @exclude_line;
}
chomp($line);