fixed "RSNAPSHOT CRITICAL: [27/Feb/2018:00:21:02] /usr/bin/rsnapshot sync: started" ($date is used inside regular expression and thus needs to be parenthesised)
authorMatthias Förste <foerste@schlittermann.de>
Tue, 27 Feb 2018 10:30:09 +0100
changeset 35 539577720214
parent 34 f6a0788c2f07
child 36 7ff8af4e9a17
fixed "RSNAPSHOT CRITICAL: [27/Feb/2018:00:21:02] /usr/bin/rsnapshot sync: started" ($date is used inside regular expression and thus needs to be parenthesised)
check_rsnapshot.pl
--- a/check_rsnapshot.pl	Tue Feb 13 15:40:15 2018 +0100
+++ b/check_rsnapshot.pl	Tue Feb 27 10:30:09 2018 +0100
@@ -42,7 +42,7 @@
 sub version($$);
 
 my $ME      = basename $0;
-my $VERSION = "2.10";
+my $VERSION = "2.10.1";
 
 my %opt = (
     binary => "/usr/bin/rsnapshot",
@@ -64,7 +64,7 @@
     my @logfiles = @ARGV ? @ARGV : glob '/var/log/rsnapshot.log{,.1.gz}';
 
     # older versions log the date as %d/%b/%Y
-    my $date = UnixDate(ParseDate($opt{date}), "%d/%b/%Y|%Y-%m-%d");
+    my $date = UnixDate(ParseDate($opt{date}), "(%d/%b/%Y|%Y-%m-%d)");
     unless ($date) {
         print "RSNAPSHOT CRITICAL: can't parse date [$opt{date}]\n";
         exit $ERRORS{CRITICAL};