0

I have an odd problem with my Debian server. Up until a few weeks ago, anacron was running my cron jobs fine and I can see I have backups from then so it was running stuff. Then it appears to have just stopped running cron tasks in /etc/cron.daily/weekly/monthly. The logs, however, don't show any issues. Here's my recent anacron log:

Nov 27 22:30:58 localhost anacron[2229443]: Anacron 2.3 started on 2023-11-27
Nov 27 22:30:58 localhost anacron[2229443]: Normal exit (0 jobs run)
Nov 27 22:30:58 localhost systemd[1]: anacron.service: Deactivated successfully.
Nov 27 23:33:19 localhost systemd[1]: Started anacron.service - Run anacron jobs.
Nov 27 23:33:19 localhost anacron[2230690]: Anacron 2.3 started on 2023-11-27
Nov 27 23:33:19 localhost anacron[2230690]: Normal exit (0 jobs run)
Nov 27 23:33:19 localhost systemd[1]: anacron.service: Deactivated successfully.
Nov 28 07:34:01 localhost systemd[1]: Started anacron.service - Run anacron jobs.
Nov 28 07:34:01 localhost anacron[2240027]: Anacron 2.3 started on 2023-11-28
Nov 28 07:34:01 localhost anacron[2240027]: Will run job `cron.daily' in 5 min.
Nov 28 07:34:01 localhost anacron[2240027]: Jobs will be executed sequentially
Nov 28 07:39:01 localhost anacron[2240027]: Job `cron.daily' started
Nov 28 07:39:02 localhost anacron[2240113]: Updated timestamp for job `cron.daily' to 2023-11-28
Nov 28 07:39:03 localhost anacron[2240027]: Job `cron.daily' terminated
Nov 28 07:39:03 localhost anacron[2240027]: Normal exit (1 job run)
Nov 28 07:39:03 localhost systemd[1]: anacron.service: Killing process 2240176 (ConfigServer Ve) with signal SIGKILL.
Nov 28 07:39:03 localhost systemd[1]: anacron.service: Killing process 2240182 (sleep) with signal SIGKILL.
Nov 28 07:39:03 localhost systemd[1]: anacron.service: Deactivated successfully.
Nov 28 08:30:42 localhost systemd[1]: Started anacron.service - Run anacron jobs.
Nov 28 08:30:42 localhost anacron[2241219]: Anacron 2.3 started on 2023-11-28
Nov 28 08:30:42 localhost anacron[2241219]: Normal exit (0 jobs run)

It seems to claim that the cron.daily (as well as weekly/monthly, further back) are running fine and exiting normally. But no backups are being made, and no emails are being sent to me (I setup a test script that should always print output and therefore generate an email). I can't for the life of my figure out why anacron apparently isn't doing anything, and isn't logging any errors.

I don't remember doing anything back a few weeks ago that could've caused this. Here's my /etc/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

What can I do to debug this and figure out what's wrong? My OS is Debian 12.1.

0

1 Answer 1

0

OK, I just discovered (thanks to this) that run-parts ignores files/links that have an extension; it doesn't match the . character. No idea why. Changed my symlinks in /etc/cron.daily not to have the .extension and now they run. Crazy.

2
  • 2
    What would happen for example when a package-provided entry is locally changed by the administrator and gets upgraded to a different content, leaving a .dpkg-old or .dpkg-new, or with an editor leaving a ~ or .bak file around? I wouldn't want the crontab entry to be executed twice because of this. Commented Nov 28, 2023 at 9:58
  • Seems to me that those files shouldn't be left in cron.daily Commented Nov 28, 2023 at 10:24

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.