In Linux, the tasks performed by the cycle are typically handled by the cron Daemon (ps-ef|grep cron). Cron reads one or more configuration files that contain the command line and its invocation time.
The cron configuration file is called "crontab" and is shorthand for "cron table".
First, cron service
Cron is a timed execution tool under Linux that can run a job without human intervention.
Service Crond Start//Startup services
Service Crond stop//Shutdown services
Service Crond restart//Restart services
Service Crond Reload//Reload Configuration
Service Crond Status//view services statuses
Ii.Brief description of/etc/crontab file configuration
/etc/crontab This file is responsible for arranging the maintenance system and other tasks that the system administrator has set up crontab
The first part of the command format is the setting of the time, followed by the command to be executed. Time setting we have a certain agreement, the preceding five * number represents five numbers, the value range and meaning of the numbers are as follows:
Minutes (0-59)
Hours (0-23)
Date (1-31)
Month (1-12)
Week (0-6)//0 on behalf of Sunday
In addition to the numbers there are several special symbols that are "*", "/" and "-", ",", "*" to represent all the values within the range of the number, "/" for each meaning, "*/5" represents every 5 units, "-" represents from a number to a number, "," separate several discrete numbers.
Here are a few examples:
Every morning 6:0 6 * * command
Every two hours: 0 */2 * * * command
Automatic restart every two minutes: */2 * * * * reboot-f
11 o'clock to 8 a.m., every two hours, eight a.m.: 0 23-7/2,8 * * * command.
Number 4th per month and Monday to Sunday, three a.m. 11:0 4 * 1-3 command
January 1 Morning 4:0 4 1 1 * command
Brief description of Crontab scheduled tasks under Linux