Title: Chapter 10 Periodic Processes
1Chapter 10Periodic Processes
- Unix System Administration
2C-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)
3Put It on Crons 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 "_at_()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/nfsf
ind 1 2 -x /usr/sbin/rtc
/usr/sbin/rtc -c /dev/null 21 30 3 -x
/usr/lib/gss/gsscred_clean
/usr/lib/gss/gsscred_clean
5Managing Crontab
- Edit crontabs
- Method 1
- setenv EDITOR vi
- crontab -e
- Method 2
- crontab -l mycrontab
- vi mycrontab
- crontab mycrontab
- Removing a crontab
- crontab -r
6Locking 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.
7Questions To Ask Yourself Periodically
- What types of services is cron well suited for?
- What happens if the program creates output and
you dont redirect it? - If /bin/sh is used to execute crontab commands,
how do you execute stuff in other shells?