Sumary
I have a similar problem with cron.daily jobs not running, but the solutions there do not apply to me.
I have setup a script that should run daily through cron.daily
. I placed my script in the /etc/cron.daily
. When the computer is on all night, the script executes normally. However, from my understanding of anacron
, if I turn off the computer and turn it on (even after the time the cron.daily
runs normally), anacron
should run the scripts that didn't run in the standard time. But, for some reason, anacron
is not triggering everyday, and it works on some days and in others it doesn't.
Details
From the community documentation it seems that anacron
should be running daily on startup
So it appears anacron is run on every startup, wake up, plug-in, and at 7:30 AM every day. Looking at the respective Changelogs and package databases, it looks like this setup is directly from Debian, and hasn't been changed since at least 2009.
but it isn't.
I tested by switching the laptop on after the time of the anacron
schedule, 7:30 AM, but it is not working. At first, I thought it was skipping days but I don't know where to search for that configuration, as I didn't change its behavior.
If you need any logs let me know, I can provide them.
Logs
/etc/log/syslog
$ cat /var/log/syslog | grep cron
Mar 10 09:40:36 computer anacron[798]: Job `cron.daily' terminated
Mar 10 09:40:36 computer anacron[798]: Normal exit (1 job run)
Mar 10 10:17:01 computer CRON[26842]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 10 11:17:01 computer CRON[27296]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 10 12:17:01 computer CRON[28337]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 10 13:14:01 computer CRON[28761]: (root) CMD ( test -x /etc/cron.daily/popularity-contest && /etc/cron.daily/popularity-contest --crond)
Mar 10 13:17:02 computer CRON[28779]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 10 14:00:48 computer systemd[1]: Started Run anacron jobs at resume.
Mar 10 14:17:01 computer CRON[30881]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 10 15:17:01 computer CRON[31557]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 10 17:19:19 computer systemd[1]: Started Run anacron jobs at resume.
Mar 10 18:17:01 computer CRON[2100]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 10 19:17:01 computer CRON[2745]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 10 20:17:01 computer CRON[3475]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 13 09:33:19 computer cron[918]: (CRON) INFO (pidfile fd = 3)
Mar 13 09:33:19 computer cron[918]: (CRON) INFO (Running @reboot jobs)
Mar 13 10:17:01 computer CRON[9045]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 13 11:17:01 computer CRON[13534]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 13 12:17:01 computer CRON[20925]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 13 13:14:01 computer CRON[21354]: (root) CMD ( test -x /etc/cron.daily/popularity-contest && /etc/cron.daily/popularity-contest --crond)
Mar 13 13:17:01 computer CRON[21377]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 13 14:17:01 computer CRON[22770]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 13 15:17:01 computer CRON[24406]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Non-filtered log for the first hours of the system on 10/03 and 13/03.
syslog
from 10 when it ran, and 13 when it didn't. I filter it throughcron
let me know if you need the whole thing or another filter. – adn Mar 13 '17 at 18:39sudo cat /var/spool/anacron/cron.daily
shows still that it was last executed on 10/03. And I have the heartbeats you mentioned on my script and still nothing. I will test with other scripts, but I thing the issue is with the configuration of anacron itself. – adn Mar 15 '17 at 14:56