Cron Job Not Running — Debug Checklist

💡If a cron job is not running, the most common causes are a syntax error in the cron expression, a command not found due to a missing PATH, a permission error on the script, or environment variables not being available in the cron context. Start by checking the cron log, then verify the expression, PATH, and file permissions.

Quick Diagnosis

If you seeno output, no errors — job silent” → it means cron ran the command but output was discarded, or the job never matched the schedule do this: redirect output to a log file and verify the cron expression with a cron parser

If you seecommand not found in cron log” → it means cron runs with a minimal PATH — the command binary is not in /usr/bin or /bin do this: use the full absolute path in the cron command, or set PATH at the top of the crontab

If you seepermission denied in cron log” → it means the script is not executable or the cron user lacks access to the file do this: run chmod +x script.sh and confirm the file is readable by the cron user

If you seecron runs locally but not on server” → it means environment variables available in your shell are not available in cron do this: source a .env file or define environment variables at the top of the crontab

Debug Steps

  1. 1Check cron daemon is running: sudo systemctl status cron
  2. 2View cron log: grep CRON /var/log/syslog | tail -20
  3. 3Verify the cron expression parses correctly using a cron parser
  4. 4Use absolute paths for all binaries: which python3 → /usr/bin/python3
  5. 5Add PATH to top of crontab: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
  6. 6Redirect output: * * * * * /script.sh >> /tmp/cron.log 2>&1
  7. 7Check script permissions: ls -la /path/to/script.sh (needs execute bit)

Test Your Cron Expression

Verify your cron expression is correct and see the next 10 scheduled run times before adding it to crontab.

Related Guides

Frequently Asked Questions

How do I check if cron is running?

Check the cron daemon status with: sudo systemctl status cron (or crond on RHEL). Then inspect /var/log/syslog or /var/log/cron for job execution entries.

Why does my cron job work in terminal but not in crontab?

Cron uses a minimal environment. The PATH does not include /usr/local/bin or your user's bin directory. Use absolute paths for all commands and binaries.

How do I capture cron job output for debugging?

Add output redirection to your crontab line: * * * * * /path/to/script.sh >> /tmp/cron.log 2>&1. The 2>&1 captures both stdout and stderr.

All tools run in your browser. Your data never leaves your device.