diff options
author | Greg Sabino Mullane | 2010-10-15 16:21:30 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2010-10-15 16:21:30 +0000 |
commit | 4d0554d1f440089dbf8ea8ab25c881f422f952fc (patch) | |
tree | 7ff731b58c011a211855b611c0c65eb6b0e292c9 | |
parent | c80788afd42c336097b374724efeab898a1e5500 (diff) |
Handle %y in logfilename template.
-rwxr-xr-x | check_postgres.pl | 2 |
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; |