crontab command
Schedule commands to run automatically with cron.
- Shell & scheduling
- Package cron / cronie
- 8 options · 10 examples
Syntax
crontab [-u user] -e | -l | -rm h dom mon dow command
Provided by the cron / cronie package. Run man crontab for the full manual.
Common options
| Option | What it does |
|---|---|
-e | Edit your crontab |
-l | List your crontab |
-r | Remove your crontab |
-u USER | Work on another user's crontab |
* * * * * | minute hour day-of-month month day-of-week |
*/N | Every N units |
@reboot | Run once at startup |
@daily / @hourly / @weekly | Shortcuts |
Examples
Edit your cron jobs
crontab -eList your cron jobs
crontab -lEdit another user's cron jobs
sudo crontab -u www-data -eEvery 5 minutes
*/5 * * * * /usr/local/bin/check.shEvery day at 2:00 AM
0 2 * * * /usr/local/bin/backup.shEvery Sunday at midnight
0 0 * * 0 /usr/local/bin/weekly.shWeekdays at 9:30
30 9 * * 1-5 /usr/local/bin/report.shAt startup
@reboot /usr/local/bin/start-app.shLog the output
0 * * * * /usr/local/bin/job.sh >> /var/log/job.log 2>&1Back up your crontab
crontab -l > crontab.bak
No example matches. Check the options table or search the guides.
Tips
- Cron runs with a minimal PATH: use full paths to commands.
- Escape % as \% inside crontab lines.
crontab guides
- Understanding Crontab in Linux with 20 Useful Examples for Scheduling Tasks Linux Commands · Updated Nov 2026
- How to Install Crontab in CentOS/RHEL 7/6/5 Linux Commands · Updated Apr 2025
- Schedule a Cron Job at Last Day of the Month Linux Commands · Updated Apr 2025
- Setting Environment Variables for Crontab Jobs Linux Commands · Updated Apr 2025
- Running a Cron Every 5 Minutes Linux Commands · Updated Apr 2025
- Running a Cron Every 10, 20 or 30 Minutes Linux Commands · Updated Apr 2025
- Running cron job every 12 hours (twice a day) Linux Commands · Updated Apr 2025
- Running a Cron job every Sunday (Weekly) Linux Commands · Updated Apr 2025
