文章在公司加班的时候写了。等啥时候有时间了再手工搬出来........
The first form of this command is used to install a new crontab from some named file or standard input if the pseudo-filename ``-'' is given
The -e option is used to edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables. After you exit from the editor, the modified crontab will be installed automatically.
man cron
man crontab
There is one file for each user's crontab under the /var/spool/cron/crontabs directory. Users are not allowed to edit the files under that directory directly to ensure that only users allowed by the system to run periodic
tasks can add them, and only syntactically correct crontabs will be written there.
cron requires that each entry in a crontab end in a newline character. If the last entry in a crontab is missing the newline, cron will consider the crontab (at least partially) broken and refuse to install it
The format of a cron command is very much the V7 standard, with a number of upward-compatible extensions. Each line has five time and date fields, followed by a command,
followed by a newline character ('\n'). The system crontab (/etc/crontab) uses the same format, except that the username for the command is specified after the time and
date fields and before the command. The fields may be separated by spaces or tabs. The maximum permitted length for the command field is 998 characters
Commands are executed by cron(8) when the minute, hour, and month of year fields match the current time, and when at least one of the two day fields (day of month, or day
of week) match the current time (see ``Note'' below). cron(8) examines cron entries once every minute. The time and date fields are:
cron searches its spool area (/var/spool/cron/crontabs) for crontab files (which are named after accounts in /etc/passwd); crontabs found are loaded into memory. Note that
crontabs in this directory should not be accessed directly - the crontab command should be used to access and update them.
cron似乎是一个进程,crontab用来管理cron表
Additionally, cron checks each minute to see if its spool directory's modtime (or the modtime on the /etc/crontab file) has changed, and if it has, cron will then examine
the modtime on all crontabs files and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified. Note that the crontab(1) com‐
mand updates the modtime of the spool directory whenever it changes a crontab.
cron logs its action to the syslog facility 'cron', and logging may be controlled using the standard syslogd(8) facility.