Random Project

Great, added one for yesterday

Since I run backups late night I needed also yesterday’s backups checked, and did: after #my $date = strftime(“%d-%b-%Y”, localtime); I added:

#Yesterday 🙂
#http://stackoverflow.com/questions/3506475/how-do-i-get-yesterdays-date-using-localtime
my $date = strftime(“%d-%b-%Y”, localtime);
my ($sec, $min, $hour, $mday, $mon, $year) = localtime();
my $yesterday_midday=timelocal(0,0,12,$mday,$mon,$year) – 24*60*60;
($sec, $min, $hour, $mday, $mon, $year) = localtime($yesterday_midday);
my $yesterdate = strftime(“%d-%b-%Y”, localtime($yesterday_midday));

and added an OR to the date check further down:
# want only todays and yesterdays jobs
next unless ($job{‘Start time’} =~ m/^Q$dateEs/) or ($job{‘Start time’} =~ m/^Q$yesterdateEs/);

thanks !