Cron Jobs Not Running? Fix It Here
Cron jobs failing to run? Usually it's a bad path or missing env. Start with the simple stuff before digging deeper.
Quick Fix (30 seconds)
Most cron failures are dumb stuff. Let's check the obvious first.
- Is cron running? Run
systemctl status cronorservice cron status. If it's dead, start it:systemctl start cron. - Check your crontab with
crontab -l. Make sure the job's there and formatted right. A typo in the time fields kills it silently. - Test the command manually. Copy the command from your crontab, run it in the terminal. If it fails, it's not cron — it's your script.
Still broken? Move to the moderate fix.
Moderate Fix (5 minutes)
Now we look at the stuff cron doesn't tell you. Cron runs with a minimal environment — no PATH, no HOME, nothing. That's the culprit 90% of the time.
- Add full paths. In your crontab, set
PATH=/usr/bin:/bin:/usr/local/bin. Or use absolute paths in your commands. Instead ofpython script.py, do/usr/bin/python3 /home/user/script.py. - Set a SHELL. Add
SHELL=/bin/bashat the top of your crontab. Some systems default to/bin/sh, which can break bash scripts. - Check file permissions. The script must be executable (
chmod +x /path/to/script). Also the user running cron needs read access to the script and write access to any log files. - Look at the cron log. On most distros, it's in
/var/log/cronor/var/log/syslog. Grep for your job name or CRON:grep CRON /var/log/syslog | grep -i your-job. You'll see errors like "No such file or directory" or "Permission denied".
If you still see nothing, move to advanced.
Advanced Fix (15+ minutes)
Alright, this is where we dig into the weeds. Something's blocking the job from running at all.
- Check SELinux or AppArmor. If enabled, they might block cron from executing your script. Check
ausearch -m avc -ts today(SELinux) oraa-status(AppArmor). Temporarily disable to test:setenforce 0. If it works, fix the policy — don't leave it disabled. - Check resource limits. Look at
/etc/security/limits.confand/etc/security/limits.d/. Cron inherits these. If your job uses too many file handles or memory, it gets killed silently. - Review the cron service unit file (systemd systems). Run
systemctl cat cron.service. See if there's aReadOnlyPathsorProtectHomedirective that blocks access to your script. Edit withsystemctl edit cron.serviceand override those. - Check for duplicate cron entries. Multiple crontabs for the same user can override each other. Run
crontab -lfor each user that might have schedules. Also check/etc/crontaband/etc/cron.d/for system-wide jobs. - Test with a dummy job. Create a simple one:
* * * * * touch /tmp/cron_test_$(date +\%s). Wait a minute, check/tmp/. If it appears, your script is the problem. If not, cron itself is broken.
One last thing: If you're using anacron (common on laptops), it only runs jobs when the system's on. Check /etc/anacrontab and systemctl status anacron. Anacron and cron can conflict.
Pro tip: Always redirect output to a log file in your crontab. Add
> /tmp/cron_output.log 2>&1at the end of each job. You'll see every error.
That covers 99% of cron failures. If none of this works, your system is haunted, and you should reinstall cron from scratch: apt purge cron && apt install cron on Debian, or yum remove cronie && yum install cronie on RHEL.
Was this solution helpful?