cron Cheatsheet - Job Scheduling
All essential cron commands organized by use case, with 43+ entries you can copy and run directly. Find the right command fast when you need it.
Back to SysOpsSchedule Format 7
* * * * * commandFormat: min hour day month weekday
*/15 * * * *Every 15 minutes (step)
0 */2 * * *Every 2 hours
0 18 * * 0-6Daily at 18:00 (0-6 range)
10 2 * * 6,7Sat/Sun at 2:10 (comma list)
0 0 * * 0Every Sunday at midnight
0 0 1 * *Monthly on the 1st at midnight
Special Strings 6
@rebootRun once at boot
@hourlyHourly (same as 0 * * * *)
@daily / @midnightDaily (same as 0 0 * * *)
@weeklyWeekly (same as 0 0 * * 0)
@monthlyMonthly (same as 0 0 1 * *)
@yearly / @annuallyYearly (same as 0 0 1 1 *)
System Cron 6
/etc/crontabSystem crontab (adds a user column)
/etc/cron.d/Drop-in task files (same format)
/etc/cron.hourly/Hourly scripts dir
/etc/cron.daily/Daily scripts dir
/etc/cron.weekly/Weekly scripts dir
/etc/cron.monthly/Monthly scripts dir
User Crontab 7
crontab -eEdit the current user's crontab
crontab -lList the current user's jobs
crontab -rRemove all jobs for the user
crontab -riRemove with confirmation prompt
crontab -u user -eroot edits another user's crontab
crontab -u user -lView another user's jobs
echo "@reboot echo hi" | crontabPipe in jobs quickly
Environment 6
SHELL=/bin/bashSet the shell cron uses
PATH=/usr/local/bin:/usr/bin:/binSet PATH (cron's default is minimal)
MAILTO="admin@example.com"Mail output to an address
MAILTO=""Disable mail (no output sent)
HOME=/rootSet the HOME dir
CRON_TZ=Asia/ShanghaiSet the cron timezone
Examples 6
0 2 * * * /path/backup.shNightly backup at 2am
*/5 * * * * curl -s https://example.com/healthHealth check every 5 minutes
0 9 * * 1-5 mail -s "Report" team@example.comEmail on weekdays at 9am
0 0 1 * * /path/cleanup.shClean temp files monthly
30 3 * * * /usr/bin/logrotate /etc/logrotate.confRotate logs daily at 3:30
0 0 * * 0 /path/weekly-report.sh >> /var/log/report.log 2>&1Weekly report with logging
Debugging 5
grep CRON /var/log/syslogCron log on Debian/Ubuntu
grep cron /var/log/cronCron log on RHEL/CentOS
dateVerify the system timezone
systemctl status cronCheck the cron service status
* * * * * echo test >> /tmp/cron-test 2>&1Debug: write a test line every minute
Tips
- Format: min(0-59) hour(0-23) day(1-31) month(1-12) weekday(0-6, 0=Sun).
- * = all, , = list, - = range, / = step.
- Use absolute paths in scripts or commands may not be found.
- cron's env is minimal; set PATH explicitly in scripts.
- Redirect output: command >> /var/log/cron.log 2>&1.
- Sun = 0 or 7 depending on distro; standardize on 0.
Official References
Commands are compiled from the official docs below. Click to verify the latest usage.
Maintained by LaoHand
Publicly updated on Jul 21, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us