etc/cron.daily not responding on time

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
bigal
Level 4
Level 4
Posts: 228
Joined: Mon Aug 03, 2009 3:26 am
Location: Pembrokeshire, South West Wales

etc/cron.daily not responding on time

Post by bigal » Thu Jun 14, 2018 4:10 pm

I have recently started using logwatch to email me a summary of the previous days logs. My entry in /etc/crontab for /etc/cron.daily is

Code: Select all

25 2	* * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
as I wanted it to run at 25 minutes past 2 in the morning or in other words at 02:25 am. But despite the above entry I am not receiving the email until 07:35 am. I looked at /var/log/mail.log and the entire output for one whole day (yesterday) is

Code: Select all

Jun 14 07:35:05 machinename postfix/pickup[26583]: E31F1A3C0A: uid=0 from=<root>
Jun 14 07:35:05 machinename postfix/cleanup[27202]: E31F1A3C0A: message-id=<20180614063505.E31F1A3C0A@**********************>
Jun 14 07:35:06 machinename postfix/qmgr[1582]: E31F1A3C0A: from=<root@**********************>, size=8606, nrcpt=1 (queue active)
Jun 14 07:35:06 machinename postfix/smtp[27212]: E31F1A3C0A: to=<*******************>, relay=*********************[**.**.**.**.**]:25, delay=2.2, delays=1.4/0.19/0.33/0.26, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as B47893C00FC)
Jun 14 07:35:06 netclient015 postfix/qmgr[1582]: E31F1A3C0A: removed
That got me puzzled so I looked at /var/log/syslog as well /var/log/syslog.1. All the entries commence at 07:36 Hrs. and finish at 07:35 Hrs. the following day. I would have expected them to run from 00:00 Hrs. to 23:59 Hrs. So do I have a setting wrong somewhere

lmuserx4849
Level 5
Level 5
Posts: 788
Joined: Wed Dec 17, 2014 2:55 am

Re: etc/cron.daily not responding on time

Post by lmuserx4849 » Sat Jun 16, 2018 2:19 am

Is your machine ever shutdown, or always running?

I think this page will answer your question: CronHowto-How Anacron is Set Up. Ubuntu, thus LM, @17.3, are in a transitional stage between Upstart (Ubuntu - lost) and systemd (Redhat - won). So don't get too hung-up on upstart, because it's going away. And system.d timers, I guess, "is the future".

For now, anacron might explain the 7:35 time you are seeing. See /etc/anacrontab & /etc/cron.d/anacron.

man anacrontab
anacron is the daemon that completes cron for computers that are not on at all times. Since regular tasks are usually scheduled for the middle of the night, they will never be executed if the computer is off at that time. The purpose of anacron is to execute them, taking into account periods in which the computer is not working.
Debian Handbook

Post Reply

Return to “Software & Applications”