Cron expression generator
Pick a preset or fill in the five fields; the generator explains the expression in plain words, shows the next five run times, and writes a cron line ready for cPanel.
Presets
Meaning
Every 5 minutes.
Next five runs
In cPanel, on the Cron Jobs page:
This tool runs in your browser. We don't store what you type and we use no trackers.
How to use it and read the results
How to use the generator
Pick a preset or edit the five fields; the expression, its meaning and the next run times update instantly. Then choose the command type, enter your cPanel username and path, and copy the line. In cPanel, open Cron Jobs, type each value into its field or use Common Settings, and paste the command into the Command box. For a full walkthrough, see the cron jobs setup guide.
At the top of the Cron Jobs page there's a Cron Email field: enter your address and remove >/dev/null 2>&1 from the command, and you'll get each run's output by email. That's handy while testing; put it back afterwards so your inbox doesn't fill up.
The five fields and the symbols
| Field | Values | Example |
|---|---|---|
| Minute | 0-59 | 30 at minute 30 |
| Hour | 0-23 | 3 at 3 am |
| Day of month | 1-31 | 1 the first of the month |
| Month | 1-12 or JAN-DEC | */3 every three months |
| Day of week | 0-6 (0 and 7 are Sunday) or SUN-SAT | 1-5 Monday to Friday |
* means every value, a comma , makes a list like 9,13,17, a dash - a range like 1-5, and a slash / a step like */10, every ten units.
Common mistakes
- Time zones: cron jobs run on the server's clock, not yours. Compare with the UTC view and shift the hour if the server is in another zone.
- Relative paths: write the full path, like
/home/USERNAME/public_html/cron.php; cron doesn't start in your site's folder. - Day of month and day of week together: when both are set, the job runs when either matches, not both. The explanation spells this out.
- Running too often: a heavy task every minute eats your account's resources, and runs can overlap if one takes long.
- A missing execute bit: a script you run directly, like
script.sh, needs755; work it out with the chmod calculator.
Added a job and nothing happens? See fixing a cron job that isn't running.
FAQ
Why isn't my cron job running?
The usual causes are a relative path instead of a full one, the wrong PHP path, or a time zone difference so it runs at another hour than you expect. Run the same command over SSH, or temporarily remove >/dev/null 2>&1 to see the error.
Can a cron job run every 30 seconds?
Cron's smallest unit is one minute. You can add two lines for the same minute, the second starting with sleep 30, but a task that frequent is better as a process that keeps running.
What does >/dev/null 2>&1 at the end mean?
It throws away the command's output and errors so you don't get an email on every run. To keep them, replace it with >> /home/USERNAME/cron.log 2>&1.