Your cron expression
Edit the fields directly, or click cells in the visual selectors below. Everything updates live.
Pick the schedule visually
Click any cell to toggle it on or off. The shortcut chips set common patterns in one click.
Minute every minute
Hour every hour
Day of month every day
Month every month
Day of week every weekday
Build the full crontab line
Type the command you want to run, choose where its output should go, then copy the ready-to-paste line into crontab -e.
* * * * * /usr/local/bin/backup.sh
Open your crontab with crontab -e and paste this on its own line. Save & exit — cron reloads automatically, no service restart needed.
Crontab decoder
Paste an existing crontab below — every line gets a plain-English explanation. Comments, environment variables and @-shortcuts are all recognized.
Paste a crontab on the left to see it explained line by line.
Quick presets
Click to load into the generator
Real-world cron jobs
Common sysadmin tasks with the cron line that runs them
Using cron on Linux — the short version
Everything you need to actually install and debug a cron job
1. Open your crontab
Each user has their own crontab. Edit yours with:
crontab -e
The first time it asks which editor to use (nano is the friendliest). To list current entries:
crontab -l
To remove everything (be careful):
crontab -r
2. Paste your line
Each entry is exactly one line. Copy the line built above and paste it on its own line in the editor. Save and quit — cron reloads automatically. No daemon restart needed.
Example:
0 3 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1
3. Where output goes
By default cron emails anything a job prints to the local user (or the address in MAILTO=). On most modern servers there is no mail setup, so output silently disappears — that is why redirecting is recommended:
>> file.log 2>&1— append stdout and stderr to a file>/dev/null 2>&1— throw it away2>&1 | logger -t myjob— send it to syslog/journald
4. Where it actually runs
cron starts the command with a minimal environment — usually just HOME, LOGNAME, PATH=/usr/bin:/bin and a basic shell. So:
- Use absolute paths for binaries:
/usr/bin/python3, notpython3. - Anything you set in
~/.bashrcis not available. - The working directory is
$HOME.cdinto the right folder if needed.
5. User vs system crontab
Two different things live side by side:
- User crontabs live in
/var/spool/cron/crontabs/<user>and are edited withcrontab -e. Five fields, then the command. - System crontab is
/etc/crontaband the drop-ins in/etc/cron.d/. These have six fields — an extra user column before the command. - Drop-in dirs
/etc/cron.{hourly,daily,weekly,monthly}/just run any executable script in them on that schedule — no cron syntax needed.
6. Test before you wait
Run the exact line first by hand to make sure it works under a stripped environment:
env -i HOME="$HOME" PATH=/usr/bin:/bin sh -c '/usr/local/bin/backup.sh'
Then check cron is running and watch its log:
systemctl status cron # Debian/Ubuntu systemctl status crond # RHEL/Fedora journalctl -u cron -f # live log of executions
7. Time zones
cron uses the system time zone. Check yours:
timedatectl
If you need a job in a different zone, prefix the command:
0 9 * * * TZ=Europe/Bucharest /opt/run.sh
8. Don't let jobs overlap
If a job might still be running when the next tick fires, wrap it in flock:
*/5 * * * * flock -n /tmp/job.lock /opt/job.sh
The -n means "fail immediately if locked" — the second invocation simply skips that minute.
Cron syntax cheatsheet
Everything you need on one screen
Field layout
┌───────── minute (0-59) │ ┌─────── hour (0-23) │ │ ┌───── day of month (1-31) │ │ │ ┌─── month (1-12) │ │ │ │ ┌─ day of week (0-6, Sun=0) │ │ │ │ │ * * * * * command
Operators
* | any value |
, | list (1,3,5) |
- | range (1-5) |
/ | step (*/15) |
L | last day of month |
? | any (Quartz only) |
Special strings
@reboot | once at boot |
@yearly | 0 0 1 1 * |
@monthly | 0 0 1 * * |
@weekly | 0 0 * * 0 |
@daily | 0 0 * * * |
@hourly | 0 * * * * |
Crontab commands
crontab -e | edit your crontab |
crontab -l | list it |
crontab -r | remove all entries |
crontab -u user -e | edit another user's |
systemctl status cron | service status |
journalctl -u cron -f | live execution log |
Pro tips for healthy cron jobs
Use absolute paths
cron runs with a minimal PATH. Write /usr/bin/python3, not python3.
Test by hand first
Run the exact command yourself before scheduling it. Most cron failures are simple environment issues.
Capture output
Add >> /var/log/job.log 2>&1 so errors don't vanish into thin air.
Prevent overlap
Use flock -n /tmp/job.lock for jobs that should never run concurrently.
Mind the time zone
cron follows the system time zone. Check it with timedatectl.
Get notified on failure
Use a service like healthchecks.io to be alerted when a job stops checking in.