Can somebody please eplain why a weekly cron job I'd assumed would run at 06:47 on Sunday morning in fact ran at 00:10 on Tuesday morning?
This is a fairly virgin Debian Stretch box (been up a while waiting for use).
I have the following crontab:
# /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and files in /etc/cron.d. These files also have username fields, # that none of the other crontabs do. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) #
And the following anacrontab:
# /etc/anacrontab: configuration file for anacron # See anacron(8) and anacrontab(5) for details. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/root LOGNAME=root # These replace cron's entries 1 5 cron.daily run-parts --report /etc/cron.daily 7 10 cron.weekly run-parts --report /etc/cron.weekly @monthly 15 cron.monthly run-parts --report /etc/cron.monthly
/usr/sbin/anacron exists and is executable.
Tue 29 Jan 15:26:23 UTC 2019
15:26:30 up 41 days, 7:03, 2 users, load average: 0.00, 0.00, 0.00
Syslog shows the weekly cronjob running at 00:10 this morning (Tuesday):
Jan 29 00:10:10 RT-ARCHIVE anacron: Job `cron.weekly' started Jan 29 00:10:10 RT-ARCHIVE anacron: Updated timestamp for job `cron.weekly' to 2019-01-29
Why this time on a Tuesday? If the system had been freshly booted I might understand it playing catchup via anacron, but it hasn't.
Also, the job didn't run on the Sunday, just to make that clear also.
I've used cron in the past without issue, what am I missing???
Just as a note to anyone arriving here, I'd to date only (knowingly) used cron, not anacron. Following this post I realise the newer virtual servers I've been provided with have anacron installed by default, whereas the older ones don't. According to the Debian Wiki, anacron is:
installed by default by Debian-Installer on laptops, and with the desktops task
So perhaps our IT guys have started setting them up differently ...