From: Greg Sabino Mullane Date: Fri, 15 Oct 2010 16:21:30 +0000 (-0400) Subject: Handle %y in logfilename template. X-Git-Tag: 2.15.1~6 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=4d0554d1f440089dbf8ea8ab25c881f422f952fc;p=check_postgres.git Handle %y in logfilename template. --- 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;