Automating maintenance in UNIX
The UNIX utility cron is also called "the system alarm clock." It is a daemon that initiates other programs that are identified in the operating system’s crontab, at an established time. The schedule is configured using the crontab command. Specifying and running a cron job is typically accomplished as root user.
To configure crontab:
minutes hours day-of-month month weekday username command
- minutes is minutes after the hour, with a range of 0-59.
- hours is the hour of the day, with a range of 0-23 (0=midnight).
- day-of-month is the day of the month, with a range of 1-31.
- month is the month of the year, with a range of 1-12.
- weekday is the day of the week, with a range of 0-6 (0=Sunday).
- username is the user name.
- command is the command or batch file.
To get a listing, use crontab -l.
To edit, use crontab -e.
For example, to set root and initiate a program:
05 0 * * 1 /usr/sbin/ksh -c ’eval ’/integrator/sbin/hcisetenv
-root ksh /cis6.1/integrator/testsite’