cron Cheat Sheet

Schedule recurring jobs with crontab — the five-field syntax every operator still reaches for.

Core DevOps3 sections · 22 commands
⌘K

Managing Jobs

5
crontab -e

Edit your crontab

crontab -l

List your cron jobs

crontab -r

Remove all of your cron jobs

crontab -u USER -l

List another user's jobs (root)

crontab FILE

Install a crontab from a file

The Five-Field Syntax

12
* * * * * CMD

Every minute

*/15 * * * * CMD

Every 15 minutes

0 * * * * CMD

Top of every hour

0 0 * * * CMD

Daily at midnight

0 2 * * 1 CMD

2:00 AM on Mondays

0 4 1 * * CMD

4:00 AM on the 1st of the month

30 3 * * 1-5 CMD

Weekdays at 3:30 AM

0 */6 * * * CMD

Every 6 hours

15,45 * * * * CMD

At minute 15 and 45

@reboot CMD

Once at boot

@daily CMD

Shorthand for 0 0 * * *

@weekday CMD

Monday–Friday at midnight

Logging & Debugging

5
0 1 * * * /path/script.sh >> /var/log/job.log 2>&1

Capture output and errors

MAILTO=""

Suppress emailed output

grep CRON /var/log/syslog

Find when jobs ran

systemctl status cron

Is cron even running

which CMD && echo ok

Verify the binary exists (PATH is limited)