Linux & VPS

Fix a Cron Job Not Running on Linux

cron job not runningscheduled task not firingworks manually but not in cron
6 min read Updated 12 June 2026 ESAGAMES Team

A cron job that runs fine by hand but never fires on schedule is a classic. It's almost always the environment cron runs in — PATH, paths, or permissions. Here's how to debug it.

Is cron even running?

Confirm the cron service is active and check the schedule:

systemctl status cron    # or crond on RHEL/Alma
crontab -l               # list this user's jobs

Cause 1: a minimal PATH

Cron runs with a bare environment, so commands that work in your shell (because of your PATH) fail. Use absolute paths for everything:

# bad:  php script.php
# good:
0 * * * * /usr/bin/php /home/user/script.php

Cause 2: relative paths inside the script

Cron doesn't run from your script's folder. Either cd into it first or use absolute paths inside the script:

0 3 * * * cd /home/user/app && /usr/bin/php backup.php

Cause 3: see the actual error — log the output

By default you never see why it failed. Redirect output to a log and read it:

0 3 * * * /usr/bin/php /home/user/backup.php >> /home/user/cron.log 2>&1
Crontab needs a final newline

A classic gotcha: a crontab file must end with a newline, or the last job silently won't run. Also remember % must be escaped as \% in cron commands.

Works by hand, not in cron = environment. Use absolute paths, log the output with >> log 2>&1, and read why it failed.

A VDS for your scheduled tasks

Run cron jobs, backups and bots reliably on our protected NVMe VDS plans in Frankfurt.

See VDS plans
FAQ

Frequently asked questions

Why does my cron job work manually but not on schedule?

Cron runs with a minimal environment and a bare PATH, and not from your script's directory. Commands or relative paths that rely on your shell setup fail. Use absolute paths and cd into the working directory.

How do I see why a cron job failed?

Redirect its output to a log file by appending >> /path/cron.log 2>&1 to the cron line. Then read that log — it shows the actual error cron hit.

Why isn't my last cron job running?

A crontab file must end with a newline character, or the final line is ignored. Add a blank line at the end. Also escape any % signs as \% in the command.

Knowledge base

Related articles

Skip the troubleshooting

Managed, protected hosting in Frankfurt — we handle the Linux, the network and the DDoS so you don't have to.

Payments Secure checkout with cards, banking apps and digital wallets.

Choose the payment flow that fits your stack and region without leaving the platform.

Pay by Zen Visa Mastercard Paysafecard PaysafeCash Skrill Trustly Bancontact UnionPay iDeal WebMoney