Minute hour day Month DayOfWeek command
minute-minutes, any integers from 0 to 59 hour-hours, any integer from 0 to 23 day-date, any integer from 1 to 31 (if a month is specified, it must be a valid date for that month) Month-month, any integer from 1 to 12 (or the English abbreviation for the month used, such as the long, Feb, etc.) Dayofweek-week, any integer from 0 to 7, where 0 or 7 represent Sunday (or use the English shorthand for the week, such as sun, Mon, etc.) command-commands to execute (commands can be commands such as Ls/proc >>/tmp/proc, or commands that execute scripts you write yourself.) )
In any of these values, the asterisk (*) can be used to represent all valid values. For example, the asterisk in the month value means that the command is executed every month after other constraints are met. A dash (-) between integers specifies a range of integers. For example,1-4 means integers 1, 2, 3, and 4. Specify a list with a series of values separated by commas (,). For example,3, 4, 6, 8 indicate these four specified integers. The forward slash (/) can be used to specify the interval frequency. Adding /<integer> after a range means that you can skip integers within the range. For example,0-59/2 can be used to define every two minutes in the minute field. The interval frequency value can also be used with the asterisk. For example, a*/3 value can be used in the month field to indicate that a task is run every three months. The line that starts with the pound sign (#) is a comment and is not processed.
4. If a cron task needs to be performed according to schedule instead of hourly, daily, weekly, or monthly execution, it can be added to the/ETC/CRON.D directory.
5, control the use of cron /etc/cron.allow and/etc/cron.deny files are used to restrict the use of cron. Both of these use control files are formatted as one user per line. No spaces are allowed for two files. If the control file is modified, the cron daemon (crond) does not have to be restarted. Using control files is read every time a user adds or deletes a cron task. The root user can always use cron, regardless of the rules in the control file. If the Cron.allow file exists, only the users listed therein are allowed to use cron, and the Cron.deny file is ignored. If the Cron.allow file does not exist, all users listed in Cron.deny are prohibited from using cron.
6. The cron daemon checks for changes in/etc/crontab files, etc/cron.d/directories, and/var/spool/cron directories every minute. If a change is found, they are loaded into memory. This way, when a crontab file changes, you do not have to restart the daemon. |