Crond is a daemon that is used to periodically perform certain tasks or wait for certain events under Linux, similar to Scheduled tasks under Windows, when the operating system is installed, the Service tool is installed by default and the Crond process is started automatically. The Crond process periodically checks to see if there is a task to perform and automatically executes the task if there are tasks to perform. In the/etc directory there is a crontab file, this is the System Task Scheduler configuration file.
In the case of unmodified, the contents of/etc/crontab are as follows:
Shell=/bin/bash Path=/sbin:/bin:/usr/sbin:/usr/bin Mailto=root# Example of job definition:
#.----------------minute (0-59)
# | .-------------Hour (0-23)
# | | .----------Day of Month ( 1-31)
# | | | .-------month (1-12) OR jan,feb,mar,apr. .
# | | | | .----Day of Week (0-6) (sunday=0 or 7) or Sun,mon,tue,wed,thu,fri,sat
# * * * * * user-name command to be execut Ed
The previous 3 lines are the environment variables used to configure the Crond task to run
In each of these fields, you can also use the following special characters:
Asterisk (*): represents all possible values, such as the month field if it is an asterisk, the command action is executed monthly after the constraints of other fields are met.
Comma (,): You can specify a list range with a comma-separated value, for example, "1,2,5,7,8,9"
Middle Bar (-): An integer range can be represented by a middle bar between integers, such as "2-6" for "2,3,4,5,6"
Forward slash (/): You can specify the interval frequency of the time with a forward slash, such as "0-23/2", which is performed every two hours. A forward slash can be used with asterisks, such as */10, if used in the minute field, which means that it executes every 10 minutes.
Sunday with 0 or 7
Case:
*/5 5-10 1-4,8-11 * 1-5 root user command commands
Every 5 minutes between 5 and 10 points from Monday to Friday, 1-4 days, 8-11 days a week
Crondtab Scheduled Tasks in Linux