CronNudge

Published October 21, 2026

Cron @reboot Not Working? Why It Didn't Run and How to Know

@reboot replaces the five time fields. It has no minute and no next run. The job runs when that cron daemon starts, which on a normal boot is during startup. A later start of the same daemon is a different event, and several common crons skip the line then.

This page is which program does what, the reasons a line stays quiet, and the log line that shows the daemon skipped it. A five-field line that never starts is crontab not running. The nickname sits with the other macros in cron expression examples. The short PATH and the home directory are cron job environment variables. Where the output went is where cron logs live. A timer or a oneshot service is systemd timers.

The Debian sentences are crontab(5) from the cron package (trixie, 3.0pl1-197, and the same paragraph in sid) and the daemon in bookworm, trixie, and sid (cron.c in 3.0pl1-162, 3.0pl1-197, and 3.0pl1-212). cronie's nickname line is its crontab(5). The skip-on-restart behavior is run_reboot_jobs in cronie's cron.c and the same function in Debian's packaged cron.c. BusyBox is upstream crond when FEATURE_CROND_SPECIAL_TIMES is compiled in. systemd is systemd.timer(5) and systemd.unit(5). macOS is launchd.plist(5). The ping behavior is CronNudge's.

What the word means

Implementation When the line runs
Debian cron (Vixie cron) At daemon startup, and only if /run/crond.reboot is absent.
cronie At daemon startup, and only if its reboot lock is absent.
BusyBox crond At daemon startup, if that binary was built with special times, and only if its reboot file can be created exclusively.
systemd-cron At the generated unit's start. This package does not run the Vixie daemon.
systemd itself There is no @reboot. Use OnBootSec= or a oneshot service.
macOS launchd There is no @reboot. RunAtLoad launches the job once when launchd loads it.

Debian's cron

cron(8) on Debian calls the daemon Vixie cron. Current crontab(5) (trixie and sid) lists @reboot as "Run once, at startup" and says that startup is the time when the cron daemon starts. It can be before other daemons or facilities are up, because of boot order. Bookworm's crontab(5) (3.0pl1-162) does not include that paragraph. The daemon in bookworm, trixie, and sid still implements the line.

On startup the packaged daemon calls run_reboot_jobs. The comment in that function is "Run on actual reboot, rather than cron restart." If /run/crond.reboot already exists, it logs Skipping @reboot jobs -- not system startup and returns. If the file is absent, it creates the file, logs Running @reboot jobs, and queues every @reboot entry. A later systemctl restart cron in the same boot finds the file and skips the lines.

/run on a systemd machine is a tmpfs. A reboot clears it, so the first start of cron after boot runs the lines. If /run is not cleared, the marker survives and the lines stay skipped. If the daemon cannot create /run/crond.reboot, it logs Can't create reboot check file and exits before the main loop, so ordinary jobs do not run either.

A user crontab is five fields, or a nickname, then the command. /etc/crontab and files in /etc/cron.d add a user name between the schedule and the command. @reboot replaces the five fields, so the system form still has the user:

# user crontab, from crontab -e
@reboot /usr/local/bin/on-boot.sh >> /var/log/on-boot.log 2>&1

# /etc/crontab or /etc/cron.d/on-boot
@reboot root /usr/local/bin/on-boot.sh >> /var/log/on-boot.log 2>&1

A user name on a user crontab becomes part of the command. A missing user name in /etc/crontab makes the command the user name. cron(8) reads /etc/cron.d in the same format as /etc/crontab, and those files do not inherit variables from /etc/crontab.

cronie

cronie's crontab(5) says @reboot means "Run once after reboot." The manual does not say that a restart of crond counts. The daemon runs the lines from run_reboot_jobs, once, after it loads the database. If the lock file exists, it logs @reboot jobs will be run at computer's startup. and returns without queueing them. That sentence means they will not run on this start. If the lock is absent, it creates the lock and queues the lines. The CMD line in the log is the evidence they ran. There is no separate "Running @reboot jobs" line.

The lock path in source is PIDDIR plus cron.reboot. PIDDIR is _PATH_VARRUN when the libc defines it. On glibc that is /var/run/, so the file is /var/run/cron.reboot. On systemd, /var/run is /run, and ls /run/cron.reboot is the same file. If the lock cannot be created, cronie logs Can't create lock for reboot jobs. and still queues the lines.

cronie is the daemon on RHEL, Fedora, Rocky, and Alma. The unit name is crond.

BusyBox crond

Upstream BusyBox crond has @reboot only when built with FEATURE_CROND_SPECIAL_TIMES. The config help lists that option as on by default and defines @reboot as "Run once, at startup." A build without the option does not treat the nickname as a schedule. The binary you have is the one that matters. crond --help does not print the nickname list.

On start, that code tries to create a file named crond.reboot in the directory where the build writes pid files, using an exclusive create. If the create succeeds, it starts @reboot lines. If the file already exists, it does not. A restart of crond in the same boot finds the file and skips them. The path is not fixed by the upstream source. Look next to the pid file that build writes.

Foreground flags, and why a container often never starts crond at all, are in cron in Docker.

systemd-cron

The systemd-cron package reads crontab files and generates systemd units. Its own crontab(5) also lists @reboot as "Run once, at startup," and it says that startup may be before other daemons or facilities are up. It does not use /run/crond.reboot. systemctl cat on the generated cron- units shows the translation. A host that installed this package instead of cron is not the Vixie daemon, even when the line looks the same.

systemd, without cron

systemd.timer(5) has no @reboot. OnBootSec= is a monotonic timer from when the machine booted. The argument is a time span: OnBootSec=30s is 30 seconds after boot. For the system manager inside a container, OnBootSec= is mapped to OnStartupSec=, so the clock is when that manager started. If the timestamp is already in the past when the timer unit is activated, the timer elapses immediately.

AccuracySec= defaults to 1 minute. The elapse is scheduled inside a window of that length, so a 30-second boot timer can fire later than 30 seconds. Set AccuracySec=1us when the second matters. OnStartupSec= is relative to when the service manager was first started. For system timers that is close to boot. For a user manager it is first login.

# /etc/systemd/system/on-boot.timer
[Timer]
OnBootSec=30s
AccuracySec=1us

[Install]
WantedBy=timers.target
# /etc/systemd/system/on-boot.service
[Unit]
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/on-boot.sh

[Install]
WantedBy=multi-user.target

WantedBy=multi-user.target is an [Install] line. systemctl enable creates the .wants/ symlink. The service starts when multi-user.target starts. systemctl restart on-boot.service runs ExecStart again. That is a service start, and it does not consult a cron reboot marker.

After=network-online.target orders the unit. It does not pull the target in. Wants=network-online.target does. Units that need a configured network use both. network-online.target means what the network manager on that host calls configured. It is not a promise that every DNS name resolves.

The ping units for a timer are in the systemd guide. This page does not repeat them. A timer that is loaded and still never elapses is systemd timer not running.

macOS launchd

launchd.plist(5) defines RunAtLoad. It launches the job once at the time the job is loaded. The default is false. That is the load event. A LaunchDaemon is loaded at boot. A LaunchAgent is loaded at login. Loading the plist again launches it once more. It is not a crontab line, and a Mac that also has a cron daemon is a second scheduler.

Why the line stayed quiet

The daemon never started at boot

Debian's cron(8) says cron is started on entering multi-user runlevels. On systemd that is the cron unit. cronie's unit is crond. If the unit is disabled, boot does not start it, and @reboot has no startup.

systemctl is-enabled cron
systemctl is-enabled crond
systemctl status cron
systemctl status crond

not-found means that name is not installed. Enable the unit the package shipped: systemctl enable --now cron on Debian and Ubuntu, systemctl enable --now crond on cronie. enable --now starts it immediately. On Debian and cronie that first start in a boot runs @reboot only when the marker file is absent. A host that has been up all day already has the marker, so enabling the unit now does not replay the lines. The next reboot does, if the unit is enabled.

The marker already existed

A restart is the wrong test on these daemons. systemctl restart cron and systemctl restart crond leave /run in place. Debian skips and logs Skipping @reboot jobs -- not system startup. cronie skips and logs @reboot jobs will be run at computer's startup. BusyBox skips when crond.reboot is already there.

To run the lines without rebooting, remove the marker and then restart the daemon:

# Debian cron
sudo rm -f /run/crond.reboot
sudo systemctl restart cron

# cronie, when the lock is /var/run/cron.reboot
sudo rm -f /var/run/cron.reboot
sudo systemctl restart crond

The job should be safe to run twice. This start is a daemon start with filesystems and the network already up. A command that fails on a real boot can succeed here. A real reboot is the other test. Compare the journal from journalctl -u cron -b (this boot) with the journal from the restart.

Network, DNS, and mounts

The daemon starts before the network is configured and before some mounts exist. Debian's manual says so. A name lookup, an NFS path, or a disk that appears later fails even though cron did start the line.

A fixed sleep waits whether or not the route is there:

@reboot sleep 30; /usr/local/bin/on-boot.sh >> /var/log/on-boot.log 2>&1

A loop can wait for a default route, then give up. /usr/bin/ip is the Debian usrmerge path. On a layout where ip is only in /sbin, use that absolute path. Cron's PATH will not find a bare ip when the directory is missing. The loop is a route check. A route can exist while DNS still fails. Wait for the name the script actually uses if the failure is a lookup.

#!/bin/sh
i=0
while [ "$i" -lt 60 ]; do
  if /usr/bin/ip route show default 2>/dev/null | grep -q .; then
    break
  fi
  i=$((i + 1))
  sleep 1
done
exec /usr/local/bin/on-boot.sh

On systemd, the durable version is the oneshot above: After=network-online.target and Wants=network-online.target. That waits for the network manager's idea of online. It does not belong in a crontab line.

PATH, the working directory, and an encrypted home

@reboot does not get a special environment. It gets the environment on the environment variables page: a short PATH, HOME from the passwd entry, and no shell profile. A command in /usr/local/bin needs a full path, or a PATH= line in that crontab.

The crontab file itself is in the spool (/var/spool/cron/crontabs on Debian's cron(8)), so an encrypted home does not hide the line from the daemon. What fails is entering HOME.

Debian's do_command.c calls chdir on HOME and does not check the result. The command still runs. The daemon's directory is /var/spool/cron (CRONDIR in pathnames.h), so a relative path such as ./scripts/on-boot.sh is resolved there when the home could not be entered. cronie's cron_change_user_permanently returns an error when chdir fails, logs ERROR chdir failed with the path, and the grandchild exits before the command. The CMD line can still be logged, because cronie logs CMD before the chdir. The error line is why there is no process afterward.

The output disappeared

Cron mails stdout and stderr to the crontab owner, or to MAILTO, unless MAILTO="". With no mail transfer agent, Debian logs that it discarded the output. The job can have run. The disk has no copy. Redirect to a file, and stamp the line so a boot and a restart are different rows. date '+%Y-%m-%dT%H:%M:%S%z' is accepted by GNU date and by BusyBox date.

#!/bin/sh
log=/var/log/on-boot.log
printf '%s start\n' "$(date '+%Y-%m-%dT%H:%M:%S%z')" >> "$log"
/usr/local/bin/on-boot.sh >> "$log" 2>&1
code=$?
printf '%s exit %s\n' "$(date '+%Y-%m-%dT%H:%M:%S%z')" "$code" >> "$log"
exit "$code"

The log directory has to exist and be writable by the user the line runs as. /var/log/on-boot.log owned by root is the wrong file for a user crontab. The rest of the mail and syslog map is the logs guide.

The container never started cron

@reboot runs when that container's cron daemon starts. If PID 1 is the application and nothing execs cron or crond, there is no startup. Debian's foreground flag is cron -f. BusyBox uses crond -f. cronie's foreground flag is crond -n. Those flags, and the case where cron is started and then reaped, are on the Docker page.

A hosted schedule has no boot

GitHub Actions does not run @reboot. The paste checker in CronNudge warns with this sentence: "GitHub Actions does not run @yearly, @monthly, @weekly, @daily, @hourly, or @reboot." That string is what /tools/github-actions shows for a macro. A workflow on.schedule entry is five fields in UTC unless that entry sets a timezone. It has no boot event.

n8n, the Laravel scheduler, Celery Beat, and Windows Task Scheduler are other programs. They are not a crontab @reboot line, and each already has its own guide.

Read the log before you reboot

Debian, this boot:

journalctl -u cron -b | grep -E 'reboot|CMD'
grep CRON /var/log/syslog

cronie:

journalctl -u crond -b | grep -E 'reboot|CMD'
grep CROND /var/log/cron
Log text Meaning
Running @reboot jobs Debian's cron created /run/crond.reboot and queued the lines.
Skipping @reboot jobs -- not system startup Debian's cron saw the marker and did not queue them.
@reboot jobs will be run at computer's startup. cronie saw the lock and did not queue them.
(user) CMD (/usr/local/bin/on-boot.sh) The daemon started that command. It is not the exit code.
ERROR chdir failed followed by a path cronie refused to run the command because it could not enter HOME.
No unit in the journal The daemon did not start. Check is-enabled.

-b is the current boot. A restart test without -b mixes yesterday's boot with today's restart. The CMD format and the mail path are in the logs guide.

What CronNudge can do with a boot job

A check is an interval or a cron expression. Both have a next time. @reboot does not. The cron parser does not accept it. Saving @reboot as the schedule returns "That cron expression did not parse." The same error is what the cron tool returns, and what the crontab paste on the check form returns. There is no check setting that means "at boot."

The ping URL is https://cronnudge.com/ping/YOUR_ID. GET, POST, and HEAD all count. Keep the URL free of a query string and of a /start or /fail suffix, then add those on the request. A paused check records the ping and does not alert.

A failed script can alert immediately

/fail is a failure. A success URL with ?exit= set to a non-zero integer from 0 through 255 is also a failure. Zero is a success. A value outside 0 through 255 is ignored, and the success URL stays a success. If the check was not already down, that failure marks it down and sends the down alert: no successful ping arrived by the deadline. The send is immediate. It does not wait for grace. A second failure while the check is already down does not send another down alert. A later success ping is the recovery: a successful ping arrived.

CRONNUDGE_URL=https://cronnudge.com/ping/YOUR_ID
@reboot /usr/local/bin/on-boot.sh; code=$?; curl -fsS -m 10 --retry 3 "$CRONNUDGE_URL?exit=$code" >/dev/null; exit "$code"

This reports the exit of a script that ran. It does not report a script cron never started. Nothing requests the URL, and CronNudge has no boot deadline to miss, so the check stays quiet. That is the limit of a one-shot ping.

A process that should stay up needs an interval

Create a second check whose schedule is an interval. The process you started at boot requests the success URL on that interval. The deadline is the last success, plus the interval, plus grace. When that time passes with no success, the sweep sends the down alert.

Free's shortest interval is 5 minutes. Pro's is 1 minute. The form's grace choices are none, 1 minute, 5 minutes (the default), 15 minutes, and 1 hour. The API accepts any whole number of seconds from 0 through 7 days. A 5-minute interval with the default grace is late 10 minutes after the last success. A reboot that takes longer than interval plus grace goes down, then recovers when the process pings again. Size the pair for how long a boot is allowed to take. The form's longest grace is 1 hour. A longer grace is an API value, up to 7 days.

One success ping at boot, on an interval check, only moves the deadline once. When the interval plus grace then passes, the check goes down, because the one-shot script is not going to ping again. Use the interval check for a process that keeps pinging. Use the ?exit= line for the one-shot script's exit code.

A slow boot task can use /start

Turn on "Track start and finish." Setting Max runtime (seconds) turns run tracking on as well. /start records a start. It is not a success. It leaves the run open.

CRONNUDGE_URL=https://cronnudge.com/ping/YOUR_ID
@reboot curl -fsS -m 10 "$CRONNUDGE_URL/start"; /usr/local/bin/slow-boot.sh; code=$?; curl -fsS -m 10 --retry 3 "$CRONNUDGE_URL?exit=$code" >/dev/null; exit "$code"

Max runtime is 1 second through 7 days. When it is set and a run is open, the deadline becomes that start time plus that many seconds. The schedule's own grace is not the earlier of the two. If no finish arrives, the sweep marks the check down and sends the stuck alert: the check is still running, and it passed its max runtime without a finish ping. The alert fires once for that start. A success ping is the recovery.

With run tracking and no max runtime, an open run is due after the grace period, and that wait is at least 60 seconds. The alert is the down alert, not the stuck alert. A check that never receives /start cannot produce the stuck alert.

The check still needs an interval or a repeating cron expression, because @reboot will not save. After the success ping, the next deadline is that schedule. A one-shot success on a 5-minute interval is late when the interval plus grace passes, unless something keeps pinging. /start bounds the run you started. It does not mean "alert me at the next boot if this never happens."

The field list is assertions, runs, and agents. The overlap alert, if a second /start arrives while a run is open, is the same document.

Plans

Free is 10 checks, a 5-minute minimum interval, and email plus one Slack or Discord channel. Output assertions and run tracking are included on 3 checks. Pro is $12 a month, 100 checks, and a 1-minute minimum interval. Pro removes the run-tracking cap. The cap does not change the check count. The numbers are on pricing. The heartbeat pattern for a line that does have a next run is how to monitor cron jobs.

FAQ

When does @reboot run? When the cron daemon starts, and only if that implementation's reboot marker is absent. Debian's crontab(5) on trixie says "Run once, at startup" and that startup is when the cron daemon starts. cronie's crontab(5) says "Run once after reboot." Bookworm's manual omits the sentence. The bookworm daemon still uses /run/crond.reboot. systemd has no @reboot string. OnBootSec= is a timer from boot, and a oneshot service with WantedBy=multi-user.target starts when that target starts. launchd RunAtLoad launches the job once when the job is loaded.

Does restarting cron run @reboot jobs again? Debian's cron, cronie, and upstream BusyBox crond with special times skip the lines while the marker file remains. Debian logs "Skipping @reboot jobs -- not system startup". cronie logs "@reboot jobs will be run at computer's startup." and skips the lines. Remove the marker and restart to queue the lines again. That start already has disks and the network. A reboot clears /run, so the next daemon start runs them. The job should be safe to run twice.

Why did the job run before the network or my home directory was ready? The daemon starts early. A sleep or a wait loop delays the command. A systemd service can use After=network-online.target and Wants=network-online.target. The crontab file lives in the spool, so an encrypted home does not hide the line. cronie logs ERROR chdir failed and does not exec the command when HOME cannot be entered. Debian's cron still execs it, and a relative path is resolved from /var/spool/cron, the daemon's directory.

Can I save @reboot as a CronNudge schedule? No. A check is an interval or a cron expression with a next run. @reboot does not parse. The form says the cron expression did not parse. Curl the ping URL with ?exit= set to the script's exit code, or request /fail. A non-zero exit alerts immediately when the check was not already down. If the script never starts, no request is sent, and there is no boot deadline, so CronNudge stays quiet.

How do I hear that a host stayed down, or that a boot task hung? Use a separate interval check that a long-running process pings on that interval. The deadline is the last success plus the interval plus grace. Free's shortest interval is 5 minutes. Pro's is 1 minute. The form offers grace of none, 1 minute, 5 minutes (the default), 15 minutes, and 1 hour. The API accepts any whole number of seconds from 0 through 7 days. For a task that can hang, ping /start and set Max runtime, from 1 second through 7 days. The stuck alert needs run tracking, an open run, and a max runtime. Free includes run tracking on 3 checks. Pro removes that cap. Free is 10 checks. Pro is $12 a month for 100 checks.

Does GitHub Actions or BusyBox run @reboot? GitHub Actions does not. The schedule checker says GitHub Actions does not run @yearly, @monthly, @weekly, @daily, @hourly, or @reboot. BusyBox crond runs it only when built with special times, and only when its reboot file can be created. systemd uses OnBootSec= or a oneshot service. A hosted cron expression has no boot event.


The line runs when that daemon starts, or it does not run at all. Create the check for the exit code and for a process that keeps pinging. Related: crontab not running, cron expression examples, environment variables, and systemd timers.