What is a cron expression?
A cron expression is a five-field string β minute, hour, day-of-month, month, day-of-week β read left to right, that tells the cron daemon when to run a scheduled command. For example, 0 2 * * 1 means 2:00 AM every Monday. Cron powers automated backups, log rotation, certificate renewal, report generation, and nearly every recurring job on Linux servers, and the same syntax appears in Kubernetes CronJobs, GitHub Actions schedules, and AWS EventBridge rules.
How do I use this generator?
Start from a preset like Daily at midnight, or set each of the five fields to one of four modes: every (*), a specific value, a range (1-5), or a step (*/15). As you edit, the tool shows the assembled expression, a plain-English description, and the next five execution times computed in your browser using your local timezone β so you can confirm the schedule actually fires when you expect before pasting it into a crontab.
Why is my cron job not running?
The usual culprit is environment: cron runs with a minimal PATH (often just /usr/bin:/bin), no shell profile, and no interactive environment, so scripts that work in your terminal fail silently under cron. Use absolute paths to binaries, set PATH at the top of the crontab, and redirect output to a log file ( >> /var/log/myjob.log 2>&1 ) to capture errors. Also check that the cron daemon is running and that the crontab file ends with a newline.
What does */5 mean in cron?
The slash defines a step value: */5 in the minute field means every 5th minute (0, 5, 10, ...), and 10-50/10 means every 10 minutes between minute 10 and 50. Ranges use a hyphen (1-5 in day-of-week is Monday through Friday) and commas list discrete values (0,30 fires on the hour and half-hour). A bare * matches every value. These can combine across fields, which is exactly where misreads happen β preview the next runs to verify.
How do I install a cron job on Linux?
Run crontab -e to edit your personal crontab, paste the expression followed by the command on one line, and save β cron picks up changes automatically, no restart needed. List existing entries with crontab -l. System-wide jobs go in /etc/crontab or drop-in files under /etc/cron.d, both of which add a sixth field for the user to run as β a common copy-paste trap when moving entries between the two formats.
What is the day-of-month vs day-of-week gotcha?
When both the day-of-month and day-of-week fields are restricted (neither is *), standard cron treats them as OR, not AND. So 0 0 13 * 5 runs on the 13th of every month AND on every Friday β not only on Friday the 13th. This surprises almost everyone. If you need true AND logic, leave one field as * and test the date inside your script, or verify intent with the next-run preview in this tool.
Should I use cron or systemd timers?
Cron is simple, universal, and fine for most recurring jobs. systemd timers (a .timer plus a .service unit, listed with systemctl list-timers) add features cron lacks: Persistent=true catches up on runs missed while the machine was off, OnBootSec handles boot-relative scheduling, output lands in journalctl automatically, and RandomizedDelaySec spreads load. On modern distros, prefer timers for jobs that must not be skipped; keep cron for quick one-liners and portability.