CronNudge

Published October 21, 2026

/etc/cron.daily Not Running? How to Find Out Why

/etc/cron.daily is a directory of scripts. It has no clock time of its own. Something else has to start run-parts on that directory: a line in /etc/crontab, anacron, or a systemd timer that starts anacron. Until you know which one this host uses, "it should have run at 6:25" is a guess.

A user crontab line that never starts is crontab not running. The same command in this directory and in a user crontab is two runs, covered in cron job running twice. The heartbeat pattern is how to monitor cron jobs.

See which program owns the directory

if test -x /usr/sbin/anacron; then echo "anacron is installed"; else echo "anacron is not installed"; fi
systemctl is-enabled anacron.service anacron.timer 2>/dev/null || true
test -f /etc/cron.hourly/0anacron && echo "cronie hourly anacron script"
test -f /etc/cron.d/dailyjobs && echo "cronie-noanacron dailyjobs file"

Debian and Ubuntu install anacron on normal systems, and the daily, weekly, and monthly lines in /etc/crontab then do nothing. cronie on RHEL, Fedora, Rocky, and Alma does the same job from /etc/cron.hourly/0anacron, unless the host has cronie-noanacron instead. Hourly scripts stay with cron on both families.

Debian and Ubuntu

Debian bookworm, Debian trixie, Ubuntu 24.04, and Ubuntu 26.04 ship these lines in /etc/crontab. crontab(5)'s example still shows parentheses and a PATH= line. The files on disk use braces:

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; }

Hourly is minute 17 of every hour, and it always runs. Daily is 06:25, weekly is Sunday at 06:47, monthly is the 1st at 06:52. test -x /usr/sbin/anacron succeeds when anacron is installed, the || stops there, and run-parts does not run. A CMD line for that daily command in the cron log only proves cron evaluated the guard. Read it before you decide the directory ran. Where those lines are written is where cron logs are.

crontab(5) says that if the machine is off through that 6am hour, only the hourly tasks run, unless you change these defaults. There is no catch-up. That is the host with no anacron.

When anacron is installed, it is what runs the directory. The job lines in /etc/anacrontab on these four releases are:

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

The first field is the period in days, the second is a delay in minutes, then a job name and the command. cron.daily waits 5 minutes. Debian bookworm and trixie also set PATH in this file. Ubuntu 24.04 and 26.04 set SHELL, HOME, and LOGNAME, and do not set PATH. Debian trixie and Ubuntu 26.04 add @yearly with a 20 minute delay for /etc/cron.yearly. Bookworm and Ubuntu 24.04 do not.

anacron is not a daemon. anacron(8) says it exits when it has nothing left to run. On systemd, two units start it:

  • anacron.service is wanted by multi-user.target, so it runs at boot. ConditionACPower=true means a machine on battery does not start it. The unit runs anacron -d -q plus ANACRON_ARGS from /etc/default/anacron, which ships as -s (one job at a time).
  • anacron.timer fires at :30 from 07:30 through 23:30, then waits a random amount up to 5 minutes (RandomizedDelaySec=5m, Persistent=true). A timer that came due while the machine was off runs after boot.

On a host that is up all night, the first timer of the day is about 07:30–07:35, then the 5 minute job delay, so cron.daily starts around 07:35–07:40. On a host that boots at 10:00 on AC power, the boot service starts anacron then, and the directory starts about 5 minutes later. That boot does not wait for 07:30. A persistent timer can start a second anacron at the same boot, and the second one finds the job locked. The timer units themselves are in systemd timers. If anacron.timer is inactive, or list-timers has no next time for it, that is systemd timer not running.

Without systemd, /etc/cron.d/anacron starts anacron at minute 30 of hours 07 through 23, and only when /run/systemd/system is absent.

Each job name is a file in /var/spool/anacron/. The file contains eight digits, YYYYMMDD, and a newline. anacron(8) uses that date and ignores the hour. A cron.daily stamp dated today means this anacron run will not start the directory again. The date is the system timezone. A clock jump that changes the calendar date is cron jobs and daylight saving time.

The anacron package also drops 0anacron into the directory. The name sorts first. The script runs anacron -u cron.daily, which writes today's date and runs no scripts. That write happens at the start of run-parts, including while the anacron that launched the directory still holds the job. If a later script hangs and the machine reboots, the stamp already says today, and the rest of the directory waits until tomorrow.

RHEL, Fedora, Rocky, and Alma

cronie does not put the daily run-parts line in /etc/crontab. /etc/crontab on Rocky Linux 9 and Fedora 43 sets SHELL, PATH, and MAILTO, and has no schedule lines. Hourly comes from /etc/cron.d/0hourly. Rocky Linux 9's file, and the same line in cronie 1.7.2, is:

01 * * * * root run-parts /etc/cron.hourly

/etc/cron.hourly/0anacron is the cronie-anacron script. If /var/spool/anacron/cron.daily already contains today's YYYYMMDD, it exits. Otherwise it starts /usr/sbin/anacron -s, unless it decides the machine is on battery. It treats the machine as on battery when it finds a mains power supply and none of them is online. Fedora 43's script also continues when /etc/default/anacron sets ANACRON_RUN_ON_BATTERY_POWER=yes. Rocky Linux 9's script does not read that file.

The anacrontab shipped by Rocky Linux 9 (cronie 1.5.7) and Fedora 43 (cronie 1.7.2) is the same:

SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
RANDOM_DELAY=45
START_HOURS_RANGE=3-22

1	5	cron.daily		nice run-parts /etc/cron.daily
7	25	cron.weekly		nice run-parts /etc/cron.weekly
@monthly 45	cron.monthly		nice run-parts /etc/cron.monthly

RANDOM_DELAY=45 adds one random number of minutes, from 0 through 45, to every job's delay for that anacron process (anacrontab(5)). cron.daily's own delay is 5, so the directory starts 5 to 50 minutes after anacron starts. On a host that is on at 03:01, that is about 03:06–03:51. The same addition applies if the first successful 0anacron of the day is 15:01: the directory then starts about 15:06–15:51. /etc/sysconfig/run-parts ships empty, so run-parts itself adds no extra wait unless you set RANDOMIZE there (crontabs(4)).

START_HOURS_RANGE=3-22 is the window in which a job is allowed to start. cronie's anacron skips the job when the time it would start, after that delay, is before 03:00 or at 22:00 or later. The skip does not write today's date, so a later hourly run the same day can still start it. anacrontab(5) says that if the machine misses the window, for example because it was powered off, the jobs are not executed that day. anacron does not stay running to try again after 22:00. cronie does not install a 0anacron script into /etc/cron.daily. It writes the date after run-parts exits, so a hang leaves the stamp unset and the next start can run the directory again.

cronie-noanacron is the package without that catch-up. It ships /etc/cron.d/dailyjobs and does not ship 0anacron. The lines run only when /etc/cron.hourly/0anacron is absent:

02 4 * * * root [ ! -f /etc/cron.hourly/0anacron ] && run-parts /etc/cron.daily
22 4 * * 0 root [ ! -f /etc/cron.hourly/0anacron ] && run-parts /etc/cron.weekly
42 4 1 * * root [ ! -f /etc/cron.hourly/0anacron ] && run-parts /etc/cron.monthly

Those are fixed times, 04:02, Sunday 04:22, and the 1st at 04:42. A machine that is off at 04:02 does not run cron.daily later.

Why a script in the directory does not run

run-parts runs the scripts one at a time, in the C locale sort of their names. 0anacron is first on Debian and Ubuntu because of that sort.

The filename

Debian and Ubuntu use debianutils run-parts. Without --lsbsysinit or --regex, run-parts(8) only accepts names made of ASCII letters, digits, underscores, and hyphens. backup.sh is ignored. backup runs. The cron and anacron lines do not pass --lsbsysinit.

d=$(mktemp -d)
printf '#!/bin/sh\necho ok\n' > "$d/backup.sh"
printf '#!/bin/sh\necho ok\n' > "$d/backup"
chmod 755 "$d/backup.sh" "$d/backup"
run-parts --test "$d"

--test prints backup and omits backup.sh. --list prints every matching name, including files that are not executable, and cannot be combined with --test. On the real directory:

run-parts --test /etc/cron.daily

cronie's run-parts, from the crontabs package on Rocky Linux 9 and Fedora 43, is a different program. backup.sh is eligible. The script skips a name that ends in ~ or ,, and the suffixes .rpmsave, .rpmorig, .rpmnew, .swp, .cfsaved, and ,v. A basename listed in jobs.deny in that directory is skipped. If jobs.allow exists, only names listed in it run (crontabs(4)). It accepts --test and --list, and it has no --report and no -v.

Mode, shebang, and line endings

debianutils run-parts runs a file only when it is executable. The owner can be someone other than root. cron(8) adds a separate rule for a symlink in these directories: both the symlink and the file it points to must be owned by root. cronie's run-parts also requires the executable bit, and its own exit status is 0 even when a script fails.

A missing shebang is not a skip. debianutils tries to execute the file, prints failed to exec ... Exec format error, and that script exits 1. A shebang with a CR/LF ending fails the same way with No such file or directory, because the interpreter name includes the carriage return. Later scripts still run. Strip the CR before you blame the schedule:

sed -i 's/\r$//' /etc/cron.daily/backup

The machine was off, on battery, or already stamped

  • No anacron, Debian or Ubuntu: the 06:25 line is the only chance that day. Off at 06:25 means no run.
  • Anacron on Debian or Ubuntu: the next boot on AC power, or the next timer firing from 07:30 to 23:30, runs it after the 5 minute delay. On battery, ConditionACPower=true means the service does not start. /etc/default/anacron sets ANACRON_RUN_ON_BATTERY_POWER for the SysV script, and the file says that setting does nothing under systemd. Clearing ConditionACPower= is the systemd override the unit's comments describe.
  • Stamp already today: anacron exits without running that job. On Debian and Ubuntu, 0anacron may have written it before your script ran.
  • cronie, machine on at 03:01: daily starts about 03:06–03:51. Machine on later, still inside the window: the same delay after that hour's 0anacron. Machine off from 03:00 until 22:00: no run that day.
  • cronie on battery: 0anacron exits before it starts anacron, so the stamp stays unchanged and a later hour on AC power can still run it.
sudo cat /var/spool/anacron/cron.daily
date +%Y%m%d

One script holds the rest

The scripts are in series. A script that never exits keeps every name after it from starting. A script that exits non-zero does not, unless you added --exit-on-error, which the Debian and Ubuntu lines do not. debianutils prints run-parts: <path> exited with return code N and still runs the next script. With one script exiting 3 and a later script succeeding, run-parts itself exits 3. cronie's run-parts keeps going and then exits 0. A hang is a stuck cron job.

PATH, and output that was mailed

The scripts do not read your shell profile. Debian's /etc/crontab and /etc/anacrontab set PATH. Ubuntu's /etc/crontab leaves PATH commented out, and cron.service starts cron -f -P. cron(8) says -P does not set PATH for child processes, so they inherit the daemon's environment. Ubuntu's anacrontab does not set PATH either. cronie's anacrontab sets PATH=/sbin:/bin:/usr/sbin:/usr/bin. Use absolute paths in the script. The user-crontab case is cron environment variables.

Anything the scripts print is mailed. cron looks for an MTA and, in the binary shipped on Ubuntu 24.04, records No MTA installed, discarding output when it cannot send. anacron mails through /usr/sbin/sendmail and records Can't find sendmail at /usr/sbin/sendmail, not mailing output when that path is missing. The job can succeed and leave you with neither a file nor a mail. Redirect inside the script if you need the output.

A container

A container that never starts cron or anacron does not run this directory, whatever files you copied in. An image without debianutils has no run-parts for the Debian command to call. Alpine and distroless images are in that group. The foreground daemon, and a ping from the job, are in cron in Docker.

Run it once, on purpose

run-parts --test prints names and runs nothing. Running the directory for real executes every eligible script as root, in order:

sudo run-parts --test /etc/cron.daily
sudo run-parts -v --report /etc/cron.daily

-v and --report are debianutils options. --report prints a script's name only when that script writes output, on the stream it writes first. On cronie, drop those flags:

sudo run-parts --test /etc/cron.daily
sudo run-parts /etc/cron.daily

cronie's script logs (/etc/cron.daily) starting <name> and finished <name> with logger, facility cron, priority notice, tag run-parts.

anacron's own test is different. -n ignores the delay and implies -s. -d stays in the foreground and copies the informational lines to stderr as well as syslog. -f ignores the timestamp. -q hides stderr and only applies with -d. Pass the job name or every due job runs:

sudo anacron -d -n cron.daily
sudo anacron -d -n -f cron.daily

The second command runs cron.daily again even when today's stamp is already set. Job output is still mailed, not printed on your terminal. -T only checks /etc/anacrontab and runs nothing. -u cron.daily writes today's date and runs nothing.

Deleting /var/spool/anacron/cron.daily makes the next anacron start treat the job as due. The next pass of 0anacron on Debian or Ubuntu, or the parent anacron after a finished run, writes the date again. Delete it when you want another run, and know that a Debian directory will stamp today as soon as 0anacron runs, before your script.

anacron(8) sends informational lines to syslog, facility cron, priority notice, and errors at error. With -d the same text is on stderr. The systemd unit passes -q, so stderr is quiet and syslog is the record. Lines you will see:

Anacron 2.3 started on YYYY-MM-DD
Will run job `cron.daily' in 5 min.
Job `cron.daily' started
Job `cron.daily' terminated
Job `cron.daily' terminated (mailing output)
Normal exit (1 job run)
Normal exit (0 jobs run)
Job `cron.daily' locked by another anacron - skipping

(mailing output) is added when the job printed something. 0 jobs run is a start that found today's stamp already set. The locked line is a second anacron while the first still holds the job. Those lines are in the anacron binaries on Debian bookworm, Debian trixie, Ubuntu 24.04, and Ubuntu 26.04. Rocky Linux 9 and Fedora 43 use Anacron started on YYYY-MM-DD without the 2.3, and the same will-run, started, locked, and normal-exit lines. journalctl -t anacron --since today and journalctl -u anacron --since today are the journal queries. cron itself is journalctl -u cron on Debian and Ubuntu, and journalctl -u crond on cronie.

Watch it with CronNudge

One check per script. A ping at the end of the last script in the directory says nothing about a script that sorts earlier and failed. Put the ping in the script, after the work, so a non-zero exit does not ping. Inside the script, % is an ordinary character. The crontab % rule applies to the crontab line, which is run-parts, not to this file.

#!/bin/sh
/usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 -o /dev/null https://cronnudge.com/ping/<your-check-id>

The check's cron expression is when you expect the success ping, in the check's timezone. Set that timezone to the host's zone. Grace is added to that time. The check is late when no success ping has arrived by then. The form offers none, 1 minute, 5 minutes, 15 minutes, and 1 hour. Five minutes is the default. The API accepts any whole number of seconds from 0 through 7 days.

Two schedules that fit the form:

  • Debian or Ubuntu, host usually on in the morning, anacron installed. The timer is 07:30 plus up to 5 minutes, then the 5 minute delay, so the directory starts by about 07:40. A check at 30 7 * * * with 1 hour of grace is late at 08:30. That covers the jitter, the delay, and a script that finishes in that hour.
  • cronie, host on at 03:00. 0anacron runs at 03:01 and the directory starts 5 to 50 minutes later. A check at 1 3 * * * with 1 hour of grace is late at 04:01. A short script fits. A script that starts at 03:51 and runs past 04:01 does not.

A longer script, or a machine that wakes hours later, needs a longer grace than the form offers. On cronie the allowed start window runs until 22:00, which is more than an hour after 03:01. On Debian and Ubuntu a boot at 16:00 starts the directory about 5 minutes later, which is also past an 08:30 deadline. Set that longer grace through the API. A success ping that arrives after the check is already down is a recovery: the alert says a successful ping arrived. Silence for the whole window, because the machine was off or on battery, is a down alert, which is the outcome you asked for.

/start is optional, for a script that runs a long time once it has started. Ping /start first, then the success URL. Turn on "Track start and finish", or set Max runtime (seconds), which turns run tracking on. Max runtime is 1 second through 7 days. When it is set, an open run is due at the start time plus that many seconds, so a script that started inside the grace is not marked down just because the schedule grace was shorter than the work. A start that never arrives cannot move the deadline. The down alert for a directory that never started is still the schedule plus grace.

CronNudge only knows about pings it receives. It cannot see the host, the timestamp file, or the directory. A paused check stores the ping and does not alert. Free is 10 checks, a 5-minute minimum interval, email, and one Slack or Discord channel. Run tracking is included on 3 checks. Pro is $12 a month for 100 checks, a 1-minute minimum, signed webhooks, and the API. The numbers are on pricing. The fields are in assertions, runs, and agents. Paste the check's expression into the cron tool and read the next runs in the host's zone.

FAQ

When does cron.daily run? When some other program runs it. With no anacron, Debian and Ubuntu run it from /etc/crontab at 06:25. With anacron, those lines do nothing: a host that stays on starts the directory about 07:35–07:40, and a host that boots later starts it about 5 minutes after boot on AC power. cronie starts it 5 to 50 minutes after hourly anacron, and keeps that start only when it falls from 03:00 until 22:00. On a host that is on at 03:01, that is about 03:06–03:51.

Why didn't my cron.daily script run? run-parts skipped the name, the file was not executable, the machine was off at the only clock time it had, anacron's stamp already said today, the host was on battery, cronie's start window was missed, an earlier script in the directory never exited, or no cron and no anacron is running. run-parts --test shows the names that would run. The stamp is /var/spool/anacron/cron.daily.

Why does cron.daily run at a random time on RHEL or Fedora? cronie's anacrontab sets RANDOM_DELAY=45 and a 5 minute delay on cron.daily, so the directory starts 5 to 50 minutes after anacron starts. anacron starts from /etc/cron.hourly/0anacron at minute 01. The directory then waits 5 to 50 minutes, and that start is kept only when it falls from 03:00 until 22:00. The hour follows when the machine was on. The extra minutes are one random value from 0 through 45.

Does cron.daily run if the computer was off? With no anacron, no. The 06:25 line, or cronie-noanacron's 04:02 line, does not catch up. With Debian or Ubuntu anacron, yes, about 5 minutes after the next boot on AC power, or after the next timer slot from 07:30 to 23:30. With cronie-anacron, yes when the delayed start falls from 03:00 until 22:00. If the machine is off for that whole window, anacrontab(5) says the jobs are not executed that day. A stamp that 0anacron already wrote on Debian or Ubuntu means the next boot will not repeat the directory.

Why is my .sh script not running in cron.daily? debianutils run-parts ignores any name that contains a dot. backup.sh never runs. Rename it to backup and keep it executable. cronie's run-parts does run backup.sh. It skips suffixes such as .rpmsave, .rpmnew, and .swp, and a name that is not executable.

How do I test cron.daily scripts? run-parts --test /etc/cron.daily lists what would run. sudo run-parts -v --report /etc/cron.daily runs them on Debian and Ubuntu. cronie's run-parts has --test and no --report. sudo anacron -d -n cron.daily runs that one job now, ignoring the delay, and prints anacron's own lines to stderr. Add -f to ignore today's stamp. The scripts' own output is mailed, so read it from run-parts if you need to see it.


Find the program that runs the directory, then make the script tell you it finished. Create the check, or read the next runs on the cron tool.