summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Sabino Mullane2010-10-15 16:21:30 +0000
committerGreg Sabino Mullane2010-10-15 16:21:30 +0000
commit4d0554d1f440089dbf8ea8ab25c881f422f952fc (patch)
tree7ff731b58c011a211855b611c0c65eb6b0e292c9
parentc80788afd42c336097b374724efeab898a1e5500 (diff)
Handle %y in logfilename template.
-rwxr-xr-xcheck_postgres.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index 2b99cf6b2..8312545b7 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -4046,11 +4046,13 @@ ORDER BY name
## We need at least hour, day, month, year
my @t = localtime;
my ($H,$d,$m,$Y) = (sprintf ('%02d',$t[2]),sprintf('%02d',$t[3]),sprintf('%02d',$t[4]+1),$t[5]+1900);
+ my $y = substr($Y,2,4);
if ($logfile !~ $logfilere) {
ndie msg('logfile-bad',$logfile);
}
$logfile =~ s/%%/~~/g;
$logfile =~ s/%Y/$Y/g;
+ $logfile =~ s/%y/$y/g;
$logfile =~ s/%m/$m/g;
$logfile =~ s/%d/$d/g;
$logfile =~ s/%H/$H/g;