Crontab can execute a shell script and execute a series of Linux commands at a specified time
Example: Server administrator regularly backs up database data, logs, etc.
Detailed
Common commands:
Crontab–e //Modify the crontab file, if the file does not exist, it will be created automatically. Crontab–l //display crontab file. Crontab-r //delete crontab file. Crontab-ir //delete crontab file before reminding the user. Service Crond Status //view crontab Services Crond start// Start Services service Crond stop //Shut Down Services service Crond Restart //Restart Services service Crond reload //Reload Configuration
Basic format:
* * * * * command
Time of day and month command
The 1th column represents minutes 00~59 per minute with * or */1
The 2nd column represents the hour 00~23 (0 means 0 points)
The 3rd column represents the date 01~31
The 4th column represents the month 01~12
5th Column Identification Number Week 0~6 (0 = Sunday)
6th List of commands to run
Some examples:
1. Run at 00:10
0 * * */home/swz/aa.sh
2, the backup job every weekday 23:59.
* * 1,2,3,4,5/home/swz/aa.sh or 1-5/home/swz/aa.sh
3. Run a command every minute
*/1 * * * */home/swz/aa.sh
4, 1th number 14:10 per month to run
1 * */home/swz/aa.sh
5, every 10 minutes to request an address regularly
0 */10 * * */usr/bin/curl http://www.aaa.com/index.php
Linux timed Execution Shell script command crontab