CHAPTER 9: PERIODIC PROCESSES
Original slides from Dr. James Walden at Northern Kentucky University.
syslogd: system logging daemon
sshd: daemon to handle incoming ssh connections
nfsd: network file system daemon
ypbind: network information service server
crond: task scheduler daemon
/var/spool/cron/username
Comment lines starting with ‘#’ are ignored by the daemon. Otherwise:
| Label | Range | Description |
|---|---|---|
| Minute | 0–59 | Minute of Hour |
| Hour | 0–23 | Hour of Day |
| Day | 1–31 | Day of Month |
| Month | 1–12 | Month of Year (or Jan, Feb, …) |
| Weekday | 0–6 | Day of Week (0=Sunday) (or Sun, Mon, …) |
# Minute, Hour, Day of Month, Month, Weekday
* * * * * echo Every minute
00 * * * * echo Every hour
00 1 * * * echo Every day at 1:00ᴀᴍ
30 */3 * * * echo Every three hours, on the half-hour
00 23 * * 0 echo 11:00ᴘᴍ Sundays
*/5 9-17 * * 1-5 echo Every five minutes, during working hours
45 10,22 * * 0,6 echo 10:45ᴀᴍ and 10:45ᴘᴍ on weekends
00 8 25 12 * echo Christmas morning
@reboot : Run once after reboot.
@yearly : Run once a year, i.e., “0 0 1 1 *”.
@annually : Run once a year, i.e., “0 0 1 1 *”.
@monthly : Run once a month, i.e., “0 0 1 * *”.
@weekly : Run once a week, i.e., “0 0 * * 0”.
@daily : Run once a day, i.e., “0 0 * * *”.
@hourly : Run once an hour, i.e., “0 * * * *”.
cron can’t help you with:
PATH=/usr/local/bin:/home/bonehead/bin:/bin:/usr/bin
MAILTO=Bonehead@ColoState.Edu
0 2 1-10 * * du -h -c -d=1 /
.chsrc, .bashrc) are not processed
crontab filename installs filename as crontab
crontab -e edits your crontab interactively
crontab -l lists the current crontab file
crontab -l >~/.crontab-backup protects you from system reconfiguration.
crontab -r removes the crontab file
crontab -r smith
/etc/cron.allow and /etc/cron.deny specify which
users can submit crontab files
30 4 25 * * mail -s "TPS" bing%End-of-month reports due
|
Modified: 2016-09-15T13:58 User: Guest Check: HTML CSSEdit History Source |
Apply to CSU |
Contact CSU |
Disclaimer |
Equal Opportunity Colorado State University, Fort Collins, CO 80523 USA © 2015 Colorado State University |
|