--- comics/fetch.pl.new 2018/02/06 14:31:06 1.24 +++ comics/fetch.pl.new 2018/02/12 13:30:58 1.25 @@ -2,6 +2,9 @@ ############################################################################### # $Log: fetch.pl.new,v $ +# Revision 1.25 2018/02/12 13:30:58 nick +# Added an easier to compare date string to determine if the status json file was updated today and report if it wasn't. +# # Revision 1.24 2018/02/06 14:31:06 nick # A status report is now generated in JSON that can easily be scanned so that # I can be alerted when there are failures that I miss if I don't read the @@ -53,7 +56,7 @@ use Date::Calc qw/Date_to_Text_Long Toda ## ## Some default values ## -my $ver = '$Id: fetch.pl.new,v 1.24 2018/02/06 14:31:06 nick Exp $'; +my $ver = '$Id: fetch.pl.new,v 1.25 2018/02/12 13:30:58 nick Exp $'; my $comicFile = "comics.conf"; my $comicConfigVer = "Unknown"; my $reportFile = "/home/httpd/html/daily/comics/status_report.json"; @@ -202,7 +205,10 @@ sub readComicConfig ($$) { sub writeStatusReportJSON ($$) { my ( $comicsRef, $filename ) = @_; my %comics = %$comicsRef; - my %json = ('date' => $DATE, 'comics' => []); + my $shortDate = sprintf("%d%02d%02d", (localtime)[5] + 1900, + (localtime)[4] + 1, + (localtime)[3]); + my %json = ('date' => $shortDate, 'comics' => []); my $totalErrors = 0; foreach my $comic (sort keys %comics) {