Overview of the cron daemon
The cron daemon is where all timed events are initiated. It is executed upon system initialization and remains active while the system is operating in multi-user mode. Cron wakes up every minute and examines all the stored configuration files, called crontabs, to check each them for commands that may be scheduled to be executed at the current time. Some systems have limits to the number of tasks that can be scheduled during the one minute time period.
Most notably, because of the low number, is SGI's IRIX 5.3 which has a limit of 25 jobs.
Besides starting commands each minute, some cron daemons also check to see if its spool directory's last modified time has been updated. If it has, cron will check the modification time on all crontabs and reread the ones that have been modified. Other cron daemons examine new crontab files when first initialized and when the commands crontab or at are executed. This reduces the overhead of checking for new or changed files at regularly scheduled intervals.
Cron searches the crontab spool directory for crontab files. These files are named after user accounts. For instance, if the system administrator is logged into the root accounts creates a crontab file, it will be named root and will be placed in the crontab spool directory. If Bill Wilson, whose username is bill, creates a crontab file it is named bill in the crontab spool directory. When executing commands, any output is mailed to the owner of the crontab (or to the user named in the MAILTO environment variable in the crontab, if such exists).
The configuration files used to control the operation of cron are called crontab files or cron tables. These files contain information about the time, date and command to execute. Different versions of UNIX store cron and support files in different locations and may use a slightly different format.
IRIX 5.3
/usr/lib/cron main cron directory
/usr/lib/cron/FIFO used as a lock file
/usr/lib/cron/log accounting information
/usr/spool/cron spool area
/usr/lib/cron/queuedefs queue description file for at, batch and cron
/usr/lib/cron/cron.allow grant access to the cron facility
/usr/lib/cron/cron.deny revoke access to the cron facility
SunOS 5.X
/etc/cron.d main cron directory
/etc/cron.d/FIFO used as a lock file
/etc/default/cron contains cron default settings
/var/cron/log cron history information
/var/spool/cron spool area
/etc/cron.d/logchecker moves log file to /var/cron/olog if log file exceeds system ulimit
/etc/cron.d/queuedefs queue description file for at, batch, and cron
/etc/cron.d/cron.allow grant access to the cron facility
/etc/cron.d/cron.deny revoke access to the cron facility
SunOS 4.X
/var/spool/cron main cron directory
/var/spool/cron/FIFO FIFO for sending messages to cron
/var/spool/cron/cron.allow grant access to the cron facility
/var/spool/cron/cron.deny revoke access to the cron facility
Linux
/var/spool/cron main cron directory
/var/spool/cron/cron.allow grant access to the cron facility
/var/spool/cron/cron.deny revoke access to the cron facility
HP-UX
/var/adm/cron main cron directory
/var/spool/cron/atjobs Directory containing at and batch job files
/var/spool/cron/crontabs Directory containing crontab files
/var/adm/cron/log Accounting information
/var/spool/cron/queuedefs queue description file for at, batch, and cron
/var/adm/cron/cron.allow grant access to the cron facility
/var/adm/cron/cron.deny revoke access to the cron facility


댓글 없음:
댓글 쓰기