0

Today I noticed that /var/spool/cron/crontabs/root line #24 was referencing a non-existent directory on my system (Ubuntu MATE 18.04.1 LTS bionic):

25  6  *  *  *  root  test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.dayly )

Question: Can anyone confirm that there is in fact a typo, and if so whether the error resides in the crontab command or in the directory name?

Answers:

  • /etc/crontab is the system-wide crontab file and /etc/cron.daily is normally called from there. In this file the spelling was as expected.
  • root's crontab is empty by default and should not duplicate the system-wide file.
  • At first it appeared as if daily cron didn't fire because there was no entry in /var/log/syslog. A search further back, however, did yield a consecutive sequence of entries (zcat /var/log/syslog.?.gz | grep -E "da[i|y]ly").
  • 1
    My /etc/cron.daily jobs run automatically each day without looking at the changes you made. I wonder though if you actually have any bash scripts in that directory? If so were they running before the change? Do they run twice after the change? – WinEunuuchs2Unix Aug 6 '18 at 20:19
  • grep daily /var/log/syslog returned nothing, but .hourly did. So I reckon that that daily cronjobs have not worked for a while until now. – Humma Kavula Aug 6 '18 at 20:24
  • Rather than grep I was thinking along the lines of ll /etc/cron.daily to see if you've even created any bash scripts there. I've create a daily backup there but by default I believe there are none. – WinEunuuchs2Unix Aug 6 '18 at 20:27
  • My script is executed from /etc/cron.daily and definitely not from /etc/cron.dayly. Not sure what you mean by ll. – Humma Kavula Aug 6 '18 at 20:51
  • Looks like a typo in your system-wide crontab file (/etc/crontab) – steeldriver Aug 6 '18 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.