Cron is a a time-based job scheduler in Unix/Linux environments. Cron can be used to schedule jobs to run periodically at fixed times, dates or intervals. Crontab is a configuration file that specifies shell commands to run periodically on a given schedule.
Users can have their own individual crontab files and often there is a system wide crontab file (usually in /etc
or a subdirectory of /etc
) that only system administrators can edit.
Crontab format
MIN HOUR DOM MON DOW <command to execute>
- MIN =Minute(0-59)
- HOUR =HOUR(0-23)
- DOM =Day Of Month(1-31)
- MON =Month(1-12)
- DOW =Day Of Week(0-6)
How to view crontab entries?
To view current user’s crontab, use “crontab -l“
eg :
To view other user’s crontab, login as root and give “crontab -u sam -l”
How do I edit crontab entries?
We can issue “crontab -e” for adding or editing crontab entries.
One reply on “What’s a cron and crontab?”
Good one.. I wish if u can write 1-2 guest posts for our blog too. Please message me if you can write. Thanks