# Cron Job Helper — Examples

> Concrete cron expressions explained: daily, every 15 minutes, weekdays, monthly and @reboot — plus a CMS and a Docker example from the Cron Job Helper.

Source: https://www.jpkc.com/db/en/tools/cron/examples/

Back to the overview: [Cron Job Helper](https://www.jpkc.com/db/en/tools/cron/) · Open the live tool: [www.jpkc.com/tools/cron/](https://www.jpkc.com/tools/cron/)

The [Manual](https://www.jpkc.com/db/en/tools/cron/manual/) explains every tab in detail. This page shows **concrete expressions** — what they mean, how to click them together in the *Builder*, and what to watch for in the *Next Scheduled Runs*. The interface is in English, so field and button names are quoted as-is.

## Example 1: Daily at 3 AM

The classic for backups and maintenance — run it when little else is happening.

```
0 3 * * *
```

How to build it: in the *Builder*, set **Minute** to *Specific value* `0`, **Hour** to *Specific value* `3`, and leave the other three fields on *Every*. Faster via the **Daily 3 AM** preset. The plain-text line confirms "at 3:00", and the *Next Scheduled Runs* show the next 03:00 occurrence each time. Read it as: minute 0, hour 3, every day, every month, every weekday.

## Example 2: Every 15 minutes

Typical for queue workers, web cron calls or scheduler triggers.

```
*/15 * * * *
```

In the *Builder*, set **Minute** to *Every N Minutes (*/N)* and enter `15` — or click the **Every 15 min** preset. The `*/15` means "every 15 units", i.e. minutes 0, 15, 30 and 45 of every hour. Mind the step value: `*/15` counts from the field minimum (0), not from "now".

## Example 3: Weekdays, on the hour during office hours

Monday to Friday, 9 AM to 5 PM only — e.g. for tasks tied to staff or customers.

```
0 9-17 * * 1-5
```

Here you combine two modes: **Hour** on *Range (A–B)* `9`–`17` and **Day of Week** on *Range (A–B)* `1`–`5` (Monday = 1, Friday = 5). **Minute** is `0`. The result: on the hour, from 9 to 17, on weekdays. If you only want it **once** on weekdays (say 08:30), use `30 8 * * 1-5`.

## Example 4: Monthly on the 1st at 4 AM

Month-end closing, reports, log rotation.

```
0 4 1 * *
```

**Minute** `0`, **Hour** `4`, **Day of Month** *Specific value* `1`, month and weekday stay `*`. This runs on the first day of every month at 04:00. Related: the **Monthly 1st** preset (`0 0 1 * *`) for midnight, or `@monthly` as a special string in *Manual Input*.

## Example 5: Once at startup — @reboot

Some jobs should run not at a clock time but **once at boot** — for instance to launch a worker or kick off a cleanup script.

```
@reboot
```

Type `@reboot` into the *Manual Input* field. The tool recognises the special string and shows no times in the *Next Scheduled Runs*, just a note that the job only runs at system startup — because `@reboot` has no recurring schedule to project into the future. Unlike the other `@` strings, `@reboot` therefore cannot be expanded into five fields.

## Example 6: Weekends at midnight

Saturday and Sunday, each at 00:00 — via a **list** in the day-of-week field.

```
0 0 * * 6,0
```

Set **Day of Week** to *List (A,B,C)* `6,0` (Saturday = 6, Sunday = 0), minute and hour to `0`. The **Weekends** preset sets exactly this. The list `6,0` nicely shows that Sunday can be written both as `0` and, in some crons, as `7` — the tool uses the `0` notation.

## CMS example: WordPress via a real cron instead of WP-Cron

WordPress's built-in **WP-Cron** only fires on page loads and is unreliable on low-traffic sites. The *CMS & Frameworks* tab shows the robust path.

Step 1 — disable WP-Cron in `wp-config.php`:

```
define( 'DISABLE_WP_CRON', true );
```

Step 2 — add a real cron every 5 minutes via WP-CLI:

```
*/5 * * * *  www-data  wp cron event run --due-now --path=/var/www/html --quiet
```

Note the fields of a system crontab line (e.g. in `/etc/cron.d/`): schedule, then **user** (`www-data`), then command. The WP-CLI path is faster than a curl call because it needs no HTTP request. If you do want curl, the tab provides the alternative on `wp-cron.php`.

## Docker example: cron in a DDEV project

In the *Docker / DDEV* tab, the simplest DDEV path is a host cron that calls into the running container via `ddev exec`.

```
*/5 * * * *  cd /home/user/myproject && ddev exec php artisan schedule:run >> /dev/null 2>&1
```

Important: `ddev exec` only works while the project is running (`ddev start`) — otherwise the line fails. For a persistent run independent of the host cron, the tab shows the recommended variant: a custom DDEV service in `.ddev/docker-compose.cron.yaml` with a `while true; … sleep 60` loop. For WordPress in DDEV there is the ready-made line `ddev wp cron event run --due-now`.

---

More context: the [overview](https://www.jpkc.com/db/en/tools/cron/) for the big picture, the [Manual](https://www.jpkc.com/db/en/tools/cron/manual/) for every tab, and the [Tips & Tricks](https://www.jpkc.com/db/en/tools/cron/tips/) for the pitfalls. Try it all directly in the [tool](https://www.jpkc.com/tools/cron/).

