The Linux system uses the crontab command to manage scheduled tasks, mainly: View the Scheduled Tasks list, edit the Scheduled tasks, and clear the scheduled tasks.
one, crontab command options
[[email protected] ~]# crontab-l//-L View scheduled Task list [[email protected] ~]# CRONTAB-E//-e edit Scheduled task [[email protected] ~]# Cront Ab-r/-R clears all scheduled tasks 123
Ii. crontab Edit the task of planning
2.1 Basic Syntax:
* * * * * * Command1
The first 5 * represents the minutes, hours, days, months, and weeks, and the command represents the order to be executed.
2.2 Special Symbols
, |
Represents a non-sequential time |
-
|
Represents a continuous time |
*/n |
How often do you represent |
2.3 Example:
3 * * */root/mysql.sh//Daily 3:30 A.M. execute/root/mysql.sh script 0 3 1,15,30 */root/mysql.sh//monthly 1th, 15th, 30th # 3 o'clock in the morning execute/R oot/mysql.sh Script 0 3 * * 1-5/root/mysql.sh//Monday to Friday 3 o'clock in the morning execute/root/mysql.sh script */10 * * * */root/mysql.sh//every 10 minutes Execute/root/mysql.sh Script
Linux Foundation-crontab Scheduled Tasks