Download presentation
Presentation is loading. Please wait.
Published byArthur McKenzie Modified over 9 years ago
1
Chapter 10 Periodic Processes Unix System Administration
2
C-Ron, C-Ron Run Cron is a daemon that periodically executes commanded defined in the crontab. Some Unix systems provide security to restrict who can run cron jobs. Cron jobs are executed using the Bourne shell (/bin/sh)
3
Put It on Cron’s Tab Format of crontab 6 space separated commands field 1 = minute of hour 0-59 field 2 = hour of day 0-23 field 3 = day of month 1-31 field 4 = month of year 1-12 field 5 = day of the week 1-7 (1 = Sunday) field 6 (to end of line) = command to execute
4
/var/spool/cron/crontabs/* #ident "@(#)root 1.19 98/07/06 SMI" /* SVr4.0 1.1.3.1 */ # # The root crontab should be used to perform accounting data collection. # # The rtc command is run to adjust the real time clock if and when # daylight savings time changes. # 10 3 * * 0,4 /etc/cron.d/logchecker 10 3 * * 0 /usr/lib/newsyslog 15 3 * * 0 /usr/lib/fs/nfs/nfsfind 1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1 30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
5
Managing Crontab Edit crontabs Method #1 setenv EDITOR vi crontab -e Method #2 crontab -l >mycrontab vi mycrontab crontab mycrontab Removing a crontab crontab -r
6
Locking Down Cron /etc/cron.d/cron.allow & /etc/cron.d/cron.deny One username per line See man crontab for details on how the rules are enforced.
7
Questions To Ask Yourself Periodically What types of services is cron well suited for? What happens if the program creates output and you don’t redirect it? If /bin/sh is used to execute crontab commands, how do you execute stuff in other shells?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.