cron 中文man页面

系统
Cron 应该由 /etc/rc 或者 /etc/rc.local 启动(译注:有很多发行版与此不同的,如 RedHat6.x 使用 /etc/rc.d/init.d/crond )。系统会立即返回提示符状态,因此没有必要后缀 '&' 来启动。 Cron 在目录 /var/spool/cron 下搜索以 /etc/passwd 中账户名命名的 crontab 文件,将找到的文件内容加载到内存中。

NAME

cron - 定期执行指定命令的守护程序 (Vixie Cron)  

总览

cron  

描述

Cron 应该由 /etc/rc 或者 /etc/rc.local 启动(译注:有很多发行版与此不同的,如 RedHat6.x 使用 /etc/rc.d/init.d/crond )。系统会立即返回提示符状态,因此没有必要后缀 '&' 来启动。 Cron 在目录 /var/spool/cron 下搜索以 /etc/passwd 中账户名命名的 crontab 文件,将找到的文件内容加载到内存中。 Cron 还搜索 /etc/crontab 和目录 /etc/cron.d/ 下的文件,但这些文件使用另外的格式。(见 crontab(5) )。 Cron 平时出于休眠状态,每分钟醒来一次,检查所有储存的 crontab 文件,检查其中的每一条命令并适时执行。执行命令时,任何输出通过邮件发往 crontab 的拥有者(如果 crontab 中设置了 MAILTO 环境变量,就发往此变量所指的用户)。

另外, cron 每分钟检查它的 spool 目录以及 /etc/crontab) 的 modtime 【译注:即文件的最新修改时间,在文件系统的 i-node 中以 mtime 标记】,如果发生变化, cron 将检查所有 crontab 文件的 modtime ,并重新加载已改变的。这意味着即使修改 crontab 文件也没有必要重新启动 cron 守护程序。注意当 Crontab(1) 命令改变 crontab 时会刷新 spool 目录的 modtime 标记。

另见

crontab(1), crontab(5)  

#p#

NAME

cron - daemon to execute scheduled commands (ISC Cron V4.1)  

SYNOPSIS

cron [-l load_avg] [-n]  

DESCRIPTION

Cron should be started from /etc/rc or /etc/rc.local. It will return immediately, so you don't need to start it with '&'. The -n option changes this default behavior causing it to run in the foreground. This can be useful when starting it out of init.

Cron searches /var/spool/cron for crontab files which are named after accounts in /etc/passwd; crontabs found are loaded into memory. Cron also searches for /etc/crontab and the files in the /etc/cron.d directory, which are in a different format (see crontab(5)). Cron then wakes up every minute, examining all stored crontabs, checking each command to see if it should be run in the current minute. 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).

Additionally, cron checks each minute to see if its spool directory's modtime (or the modtime on /etc/crontab) has changed, and if it has, cron will then examine the modtime on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified. Note that the Crontab(1) command updates the modtime of the spool directory whenever it changes a crontab.  

Daylight Saving Time and other time changes

Local time changes of less than three hours, such as those caused by the start or end of Daylight Saving Time, are handled specially. This only applies to jobs that run at a specific time and jobs that are run with a granularity greater than one hour. Jobs that run more frequently are scheduled normally.

If time has moved forward, those jobs that would have run in the interval that has been skipped will be run immediately. Conversely, if time has moved backward, care is taken to avoid running jobs twice.

Time changes of more than 3 hours are considered to be corrections to the clock or timezone, and the new time is used immediately.  

PAM Access Control

On Red Hat systems, crond now supports access control with PAM - see pam(8). A PAM configuration file for crond is installed in /etc/pam.d/crond . crond loads the PAM environment from the pam_env module, but these can be overriden by settings in the crontab file.  

SIGNALS

On receipt of a SIGHUP, the cron daemon will close and reopen its log file. This is useful in scripts which rotate and age log files. Naturally this is not relevant if cron was built to use syslog(3).  

CAVEATS

In this version of cron, /etc/crontab must not be writable by any user other than root. No crontab files may be links, or linked to by any other file. No crontab files may be executable, or be writable by any user other than their owner.  

SEE ALSO

crontab(1), crontab(5), pam(8)  

责任编辑:韩亚珊 来源: CMPP.net
相关推荐

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-25 15:39:42

fcloseall中文man

2011-08-25 15:00:15

cfgetispeed中文man

2011-08-19 18:35:50

issue中文man

2011-08-25 17:03:51

pclose中文man

2011-08-25 17:40:25

setvbuf中文man

2011-08-23 14:21:16

poweroff中文man

2011-08-24 15:52:59

intro中文man

2011-08-23 13:40:31

2011-08-25 15:54:08

ferror中文man

2011-08-25 17:24:54

puts中文man

2011-08-25 18:34:55

ungetc中文man

2011-08-23 10:03:40

useradd中文man

2011-08-23 10:29:02

chpasswd中文man

2011-08-23 10:34:22

convertquot中文man

2011-08-23 15:39:34

rpmbuild中文man

2011-08-24 15:48:38

INSERT中文man
点赞
收藏

51CTO技术栈公众号