Published October 21, 2026
Crontab Not Running? 12 Fixes That Actually Work
The script works when you run it by hand. You add it to crontab. Nothing happens, and there's no error anywhere. This is one of the most common problems on Linux, and it almost always has one of a dozen causes.
Work through these in order. The first three cover most cases.
Step zero: find out what cron thinks happened
Before guessing, look at the logs.
# Debian / Ubuntu
grep CRON /var/log/syslog | tail -n 20
# systemd-based systems (RHEL, Fedora, Arch, newer Ubuntu)
journalctl -u cron --since "1 hour ago" # Debian/Ubuntu unit name
journalctl -u crond --since "1 hour ago" # RHEL/Fedora unit name
# RHEL / CentOS without journald
tail -n 20 /var/log/cron
If you see a line like CMD (/home/deploy/backup.sh), cron started your job, and the problem is inside the job. If you see nothing, the problem is the schedule, the crontab itself, or the cron daemon. On cPanel, Plesk, or other shared hosting you cannot read that system log, and the account-level checks are in cPanel cron job not running and Plesk scheduled task not running.
Then capture the job's output, which cron otherwise throws away or tries to email:
*/5 * * * * /home/deploy/backup.sh >> /tmp/backup.log 2>&1
Most of the fixes below become obvious once you can read that log. Where each distro keeps the cron log, plus timestamps and rotation for job output, are in where are cron logs.
1. The cron daemon isn't running
systemctl status cron # Debian / Ubuntu
systemctl status crond # RHEL / Fedora / Amazon Linux
If it's inactive, start and enable it:
sudo systemctl enable --now cron
In Docker containers this is very common: most base images don't run a cron daemon at all. You need to install one and run it as the container's process, or use your platform's scheduler instead. Foreground flags, the environment cron does not inherit, and the ping are in monitor cron jobs in Docker. A line written as @reboot runs at daemon startup, and enabling the unit is only the first check: cron @reboot not working.
WordPress scheduled posts can miss while this daemon is healthy, because WP-Cron is spawned by a page load until a crontab line replaces it: WP-Cron not running. A job moved to a systemd timer is a different pair of units, and a timer that never elapses is systemd timer not running. A Windows PC has no crontab. A task that does not fire there is Task Scheduler task not running. A Laravel app that looks idle often has the same missing minute line: the crontab entry that should run php artisan schedule:run is Laravel scheduler not running. A repository with no server has no crontab, and a workflow that does not fire there is GitHub Actions schedule not running.
2. PATH is different under cron
Cron runs with a minimal environment. On many systems, PATH is only /usr/bin:/bin. Anything in /usr/local/bin, ~/.local/bin, a Node version manager, or a Python virtualenv isn't found.
Fix it by using absolute paths:
0 3 * * * /usr/local/bin/node /home/deploy/app/scripts/cleanup.js
or by setting PATH at the top of the crontab:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
0 3 * * * cleanup.sh
Find the absolute path of a command with command -v node.
3. Your shell profile isn't loaded
Cron doesn't read ~/.bashrc, ~/.profile, or ~/.zshrc. Environment variables you exported there, like API keys, NODE_ENV, or JAVA_HOME, don't exist in the job.
Set them in the crontab, source a dedicated env file in your script, or load them explicitly:
#!/usr/bin/env bash
set -euo pipefail
source /home/deploy/app/.env.cron
To reproduce cron's environment for testing, run your command with almost nothing set:
env -i HOME="$HOME" PATH=/usr/bin:/bin /bin/sh -c '/home/deploy/backup.sh'
If it fails there, it'll fail in cron. PATH, SHELL, HOME, a mode 0600 env file, systemd Environment=, and the env dump are in cron job environment variables.
4. Relative paths and the working directory
Cron starts jobs in the user's home directory, not in your project folder. A script that does ./data/export.csv or require('./config') with a relative path breaks.
Use absolute paths, or cd first:
0 3 * * * cd /home/deploy/app && ./scripts/export.sh
5. The script isn't executable, or has the wrong shebang
ls -l /home/deploy/backup.sh
chmod +x /home/deploy/backup.sh
head -n 1 /home/deploy/backup.sh # should be something like #!/usr/bin/env bash
Without a shebang, cron runs the file with /bin/sh, which on Debian and Ubuntu is dash, not bash. Bash-only syntax like [[ ]], arrays, or source fails.
6. Cron uses /bin/sh, not bash
Related to the above: the command line in crontab is run by /bin/sh unless you set SHELL. Inline bash-isms break.
SHELL=/bin/bash
0 * * * * [[ -f /tmp/flag ]] && /home/deploy/run.sh
Moving the logic into a script with a proper shebang is usually cleaner.
7. Unescaped % signs
In crontab, % means "newline," and everything after the first % becomes standard input to the command. This breaks the very common date pattern:
# Broken
0 2 * * * tar czf /backups/site-$(date +%F).tgz /var/www
# Fixed
0 2 * * * tar czf /backups/site-$(date +\%F).tgz /var/www
8. The file is missing its final newline, or has Windows line endings
Many cron implementations ignore a last line that doesn't end in a newline. If your crontab was edited on Windows, \r characters can also corrupt the command.
crontab -l | cat -A | tail -n 3 # lines should end in $, not ^M$
Fix CRLF with dos2unix, and make sure the file ends with an empty line. The same applies to scripts: a script with CRLF endings fails with /usr/bin/env: 'bash\r': No such file or directory.
9. You edited the wrong crontab, or used the wrong format
There are several places cron reads from, and they don't share a format:
| Location | Edited with | Has a user field? |
|---|---|---|
| per-user crontab | crontab -e |
no |
/etc/crontab |
a text editor | yes |
/etc/cron.d/* |
a text editor | yes |
A line copied from crontab -e into /etc/cron.d/ without a username is treated as if the first word of your command were the user, and it silently fails. The reverse also breaks.
Also check whose crontab it is. sudo crontab -e edits root's, not yours. List both:
crontab -l
sudo crontab -l
The same command in two of those files, or pasted twice in one of them, starts twice. That diagnosis is cron job running twice.
10. /etc/cron.d and run-parts filename rules
On Debian-based systems, files in /etc/cron.d/ and scripts in /etc/cron.daily/ are skipped if their names contain a dot. backup.sh in /etc/cron.daily/ is ignored, and backup runs. When /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly actually run, and how anacron changes that, is /etc/cron.daily not running. Check what would run:
run-parts --test /etc/cron.daily
Files in /etc/cron.d/ also need to be owned by root and not group- or world-writable.
11. Time zone or schedule misunderstanding
The job might be running, just not when you think.
- Cron uses the system time zone (
timedatectlshows it). A server set to UTC runs0 9 * * *at 09:00 UTC. - If you changed the system time zone, restart cron so it picks up the change.
- Day-of-month and day-of-week are OR'd:
0 9 1 * 1runs on the 1st and on every Monday. */45in the minute field runs at :00 and :45, not every 45 minutes.
Paste the schedule into the crontab explainer to see the next run times in plain English. Skipped hours and repeated hours are in cron jobs and daylight saving time.
12. Permissions: cron.allow, cron.deny, and file access
If /etc/cron.allow exists, only users listed in it can use crontab. If only /etc/cron.deny exists, everyone except those listed can. A blocked user typically sees an error from crontab -e, but a crontab installed earlier may simply stop running.
Also remember the job runs as the crontab's owner. If the script writes to a directory only root can write, or reads an SSH key only your interactive session can unlock (via an agent), it fails under cron. Commands that need sudo will hang or fail because there's no terminal to type a password. A process that stays running is different from a line that never started. How to tell, and how to cap it, is cron job stuck or hanging.
A cron line template that avoids most of these
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# m h dom mon dow command
0 3 * * * cd /home/deploy/app && /usr/bin/flock -n /tmp/backup.lock ./scripts/backup.sh >> /var/log/app/backup.log 2>&1
SHELLandPATHremove the environment surprises.cdfixes relative paths.flock -nprevents a slow run from overlapping with the next one.- The redirect keeps a log you can actually read.
Stop finding out days later
Every fix above is about a job that silently didn't run. You only discover it when someone asks where the backup is. The reliable way to catch this is a heartbeat: the job pings a URL when it succeeds, and you're alerted when a ping doesn't arrive on time.
0 3 * * * /home/deploy/app/scripts/backup.sh && curl -fsS -m 10 --retry 3 https://cronnudge.com/ping/<your-check-id> > /dev/null
It catches every failure mode on this page, including the daemon being down and the server being off, because those all end the same way: no ping.
FAQ
How do I know if cron ran my job at all?
Check /var/log/syslog (Debian/Ubuntu), /var/log/cron (RHEL), or journalctl -u cron. A CMD line means cron started it.
Why does my script work manually but not in cron?
Almost always the environment: a different PATH, missing variables from your shell profile, a different working directory, or /bin/sh instead of bash.
Do I need to restart cron after crontab -e?
No. Cron picks up changes made with crontab -e automatically. Files edited directly in /etc/cron.d/ are also re-read on most systems, but restarting doesn't hurt.
Where does cron output go?
By default, cron tries to email it to the crontab's owner (or MAILTO). With no mail server configured, it's lost. Redirect output to a file.
Why isn't my script in /etc/cron.daily running?
On Debian-based systems, run-parts skips filenames with dots. Rename backup.sh to backup and make sure it's executable.
How do I run cron in Docker?
Install a cron daemon in the image and run it in the foreground (for example cron -f), or prefer your orchestrator's scheduler, such as a Kubernetes CronJob.
The whenever gem only writes this crontab. Rails scheduled jobs covers that path. Render, Railway, and Fly.io covers cron the platform starts for you.
CronNudge alerts you when a scheduled job does not check in on time. Free is 10 checks, with email and one Slack or Discord channel. Pro is $12 a month for 100 checks, and adds signed webhooks and the API. Set up your first check.