This cron expression generator works both ways. Paste a schedule from your hosting panel and it tells you in plain English when the job runs, with the next five run times in your own time zone. Or build one from common presets and the five fields, choose a curl, wget or PHP command, and copy a full line ready for cPanel, DirectAdmin or crontab.

What a cron job is

Cron is the scheduler on Linux servers, and almost every shared hosting plan has it under a name like Cron Jobs. You give it a time pattern and a command, and the server runs the command on that schedule. Websites use it for backups, sending newsletters, clearing caches, checking links and publishing scheduled posts. Bloghints itself has a small cron.php that runs background tasks such as weekly rechecks.

Many CMSs have a "fake cron" that runs only when someone visits the page. On a quiet site, scheduled jobs then run late or not at all. A real cron job fixes that.

The five fields

FieldAllowed valuesExample
Minute0–5930 = at half past
Hour0–233 = 3 in the morning
Day of month1–311 = the first
Month1–12 or JAN–DEC* = every month
Day of week0–7 or SUN–SAT (0 and 7 are Sunday)1-5 = Monday to Friday

Each field takes the same building blocks:

  • * means every value.
  • A number, such as 15.
  • A list, such as 1,15.
  • A range, such as 9-17.
  • A step, such as */10 for every tenth value, or 0-30/5.

Some systems also accept shortcuts: @hourly, @daily, @weekly, @monthly and @yearly. The tool reads those too.

How to use the cron expression generator

  1. Paste or pick. Paste an expression in the top box, or choose a common schedule from the list.
  2. Read the sentence. "At 02:30, on Monday" tells you at once if the schedule is what you meant.
  3. Check the next five runs. They are shown in your browser's time zone. If the dates look wrong, the expression is wrong.
  4. Fine-tune the fields one by one. The expression updates as you type.
  5. Add the command. Pick curl or wget to open a URL, or PHP to run a file, and type the URL or path. Copy the full line.
Illustration of a clock, a calendar and a repeating arrow leading to a terminal window

Examples you will use

ExpressionRuns
*/15 * * * *Every 15 minutes
0 * * * *Every hour, on the hour
0 3 * * *Every day at 03:00
30 2 * * 1Every Monday at 02:30
0 9 * * 1-5Weekdays at 09:00
0 4 1 * *The first day of each month at 04:00

Testing a new job safely

Before you trust a new job, run it once by hand. Open the URL in your browser, or run the PHP command in the hosting terminal if you have one, and make sure it finishes without errors. Then set the schedule to every 5 minutes for a short test, watch it run twice, and change it to the real schedule. Last, write down what each job does in a note next to it, because a year later nobody remembers why a script runs at 04:17 every Sunday.

Mistakes the tool catches

  • Six fields. Some schedulers, such as Quartz in Java, add a seconds field. Hosting panels use five. The tool says so instead of guessing.
  • Out-of-range values, such as minute 60 or hour 24.
  • Dates that never come, such as the 31st of February. The tool shows no next run.
  • Both day fields set. 0 4 1 * 1 does not mean "the first, if it is a Monday". Cron runs when either field matches: on the first of the month and on every Monday. The sentence spells this out.

Time zones and other practical points

The server runs cron in its own time zone, which is often UTC. If you live in Jakarta (UTC+7) and want a job at 03:00 your time on a UTC server, set the hour to 20 the day before. Check your hosting panel: some show the server time next to the cron form.

Most shared hosts allow a job every 5 or 15 minutes at most, and some send an email every time a job prints output. That is why the generated line ends with >/dev/null 2>&1, which throws the output away. Leave it off while you test, so you see errors.

For the PHP command, the path to PHP differs between hosts: /usr/local/bin/php and /usr/bin/php are the usual ones. Your host's help pages give the right one, and some panels show it above the cron form.

Keep jobs light and spread them out. Ten jobs all set to minute 0 start together and can slow the site for a moment; set them to minutes 3, 7, 12 and so on. Build each schedule in the cron expression generator, read the sentence, and check the next runs before you save it on the server.

Frequently asked questions

What does */5 mean in cron?

It means every fifth value of that field. In the minute field, */5 runs at minutes 0, 5, 10 and so on up to 55, so twelve times an hour.

Why did my cron job not run?

The usual causes are a different server time zone, a wrong path to PHP or the script, a URL that needs a login, or a host limit on how often jobs may run. Remove the >/dev/null part while testing so the host emails you the error.

Can cron run a job every 30 seconds?

Not directly: the smallest unit in standard cron is one minute. Some people start a script twice per minute with a sleep in between, but most shared hosts do not allow jobs that often anyway.