# Cron Expression Builder

> One page from jmrp.io, published as markdown. Index: https://jmrp.io/llms.txt

Canonical: https://jmrp.io/tools/cron-builder/
Language: en
Alternate: https://jmrp.io/es/tools/cron-builder/index.md
Updated: 2026-09-03
License: https://jmrp.io/license/
Category: developer
Tags: cron, scheduling, linux, crontab, automation

Visual cron expression builder with interactive field selectors, presets, next execution preview, and crontab output. Runs client-side.
Build-Date: 2026-09-06

Features:
- Build cron expressions with visual field selectors
- Choose from 14 common schedule presets
- Read human-readable schedule descriptions
- Preview the next 10 executions
- Generate crontab lines and shareable links

Questions answered:

**What is a cron expression?**

A cron expression is a string of five space-separated fields (minute, hour, day of month, month, day of week) that tells a Unix-like scheduler when to run a task repeatedly.

**How do I run a cron job every 5 minutes?**

Use the step syntax "*/5 * * * *". You can build it here by selecting the minute field's step or picking the "every 5 minutes" preset, then copy the generated crontab line.

**Does this tool send my cron expression to a server?**

No. All parsing, the human-readable description, and the next-execution preview run entirely in your browser. The shareable link only encodes the expression in the URL.

**What happens when both day of month and day of week are set?**

Most cron implementations use OR logic: when neither field is "*", the job runs whenever either the day-of-month or the day-of-week condition matches.

**Why does my cron job fail even though the schedule is correct?**

Cron runs with a minimal PATH and the system timezone, so use absolute paths for commands and check timedatectl. Redirect output with ">> /var/log/myjob.log 2>&1" to capture errors.


---

**Interactive tool** — this page hosts the working application itself, not a description of one.

## About This Tool

Build cron schedule expressions using a visual interface with interactive
field selectors. Click values to toggle them, use quick-pick buttons, or type
expressions directly. The tool shows a human-readable description, previews
the next 10 executions, and generates a ready-to-use crontab line.

### Features

- **Interactive field selectors** — click individual values for minute (0–59), hour (0–23), day of month (1–31), month (1–12), and day of week (0–6) with visual toggle buttons
- **Quick-pick helpers** — "Every (*)" and "Clear" buttons per field for fast selection
- **Bidirectional sync** — edit the expression text and selectors update, or click selectors and the expression updates
- **Smart expression generation** — automatically detects step patterns (`*/5`), ranges (`1-5`), and lists ( `1,15`) from selected values
- **14 common presets** — every minute, 5/15/30 min, hourly, 6h, 12h, daily, twice daily, weekdays, weekly, monthly, quarterly
- **Human-readable description** — natural language translation of the expression with day and month names
- **Next 10 executions** — preview upcoming runs with relative times (in Xd Xh, in Xh Xm)
- **Crontab line output** — editable command field that combines with the expression for a ready-to-paste crontab line
- **Copy & share** — copy the expression, the full crontab line, or a shareable URL with the expression encoded
- **Inline syntax reference** — expandable quick reference for `*`, `,`, `-`, `/` symbols and the field diagram

### How do I use this tool?

1. Click values in the **Field Selectors** to toggle them. Use "Every (*)" to select all values or "Clear" to deselect all.
2. Or type a cron expression directly in the input field — selectors sync
  automatically.
3. Check the **human-readable description** to verify the schedule matches your intent.
4. Review the **Next 10 Executions** to confirm the timing.
5. Edit the command in the **Crontab Line** section and copy the full line to paste into your crontab.
6. Click **Share Link** to copy a URL that pre-fills the expression.

### What is the cron expression format?

A standard cron expression consists of **5 fields** separated by spaces:

| Field | Range | Special Characters |
| --- | --- | --- |
| Minute | `0–59` | `* , - /` |
| Hour | `0–23` | `* , - /` |
| Day of Month | `1–31` | `* , - /` |
| Month | `1–12` | `* , - /` |
| Day of Week | `0–7` (0 and 7 = Sunday) | `* , - /` |

### Special Characters

- `*` — matches **any value**. `* * * * *` runs every minute.
- `,` — **list** of values. `1,15 * * * *` runs at minute 1 and minute 15.
- `-` — **range** of values. `0 9-17 * * *` runs every hour from 9 to 17.
- `/` — **step** interval. `*/10 * * * *` runs every 10 minutes. `0 */6 * * *` runs every 6 hours.

### Shortcut Strings

Some cron implementations support these shortcut strings (not all systems —
check your documentation):

| Shortcut | Equivalent | Description |
| --- | --- | --- |
| `@yearly` | `0 0 1 1 *` | Once a year (January 1st) |
| `@monthly` | `0 0 1 * *` | Once a month (1st day) |
| `@weekly` | `0 0 * * 0` | Once a week (Sunday) |
| `@daily` | `0 0 * * *` | Once a day (midnight) |
| `@hourly` | `0 * * * *` | Once an hour (:00) |
| `@reboot` | — | Run once at system startup |

### Common Patterns

| Expression | Description |
| --- | --- |
| `*/5 * * * *` | Every 5 minutes |
| `0 */2 * * *` | Every 2 hours at :00 |
| `0 9,17 * * 1-5` | Weekdays at 9 AM and 5 PM |
| `30 2 * * 0` | Sundays at 2:30 AM |
| `0 0 1,15 * *` | 1st and 15th of each month at midnight |
| `0 4 * * 6` | Saturday at 4 AM (maintenance window) |
| `0 0 1 1,4,7,10 *` | Quarterly (first day of Jan, Apr, Jul, Oct) |

### Is my data private?

All expression parsing and execution calculation happens entirely in your
browser. No cron data is transmitted to any server. The shareable link only
encodes the expression in URL parameters.

### Linux Command Reference

Essential crontab commands for managing scheduled tasks:

#### View Current Crontab

```bash
crontab -l
```

**Output — Your Crontab**

```text
# Backup every day at 3 AM
0 3 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1
# Cleanup temp files weekly
0 0 * * 0 find /tmp -mtime +7 -delete
```

#### Edit Crontab

```bash
crontab -e
```

**Output — Edit Crontab Result**

```text
# Opens your crontab in $EDITOR (nano, vim, etc.)
# Save and exit to install the new crontab
```

#### Install Crontab from File

```bash
echo "0 3 * * * /usr/local/bin/backup.sh" | crontab -
```

**Output — Install Result**

```text
# Replaces entire crontab with the piped content
# WARNING: This overwrites all existing entries
```

#### Append Job to Existing Crontab

```bash
(crontab -l 2>/dev/null; echo "*/5 * * * * /usr/local/bin/monitor.sh") | crontab -
```

**Output — Append Result**

```text
# Safely appends without removing existing jobs
```

#### View Another User's Crontab (root)

```bash
sudo crontab -u www-data -l
```

**Output — www-data's Crontab**

```text
0 */6 * * * /var/www/scripts/cache-warm.sh
```

#### System-Wide Cron Jobs

```bash
ls -la /etc/cron.d/ /etc/cron.daily/ /etc/cron.hourly/ /etc/cron.weekly/ /etc/cron.monthly/
```

**Output — System Cron Directories**

```text
/etc/cron.d/:
e2scrub_all  geoipupdate  sysstat
/etc/cron.daily/:
apt-compat  dpkg  logrotate  man-db  sysstat
/etc/cron.hourly/:
(empty)
/etc/cron.weekly/:
man-db
/etc/cron.monthly/:
(empty)
```

### Important Notes

- **Timezone** — cron uses the system timezone by default. Check with `timedatectl` or set the `TZ` environment variable at the top of your crontab.
- **PATH** — cron runs with a minimal `PATH`. Always use absolute paths for commands (`/usr/bin/python3`, not `python3`).
- **Output** — by default, cron emails output to the user. Redirect stdout and stderr to a file: `>> /var/log/myjob.log 2>&1`.
- **Day-of-month + Day-of-week** — when both fields are set (not `*`), cron uses **OR** logic: the job runs if *either* condition matches.
- **Debugging** — check `/var/log/syslog` (Debian/Ubuntu) or `/var/log/cron` (RHEL/CentOS) for execution logs.

