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.
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“
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.