Grammar
Format: * * * * * * * * * * * * * * * * The task of the Year
For example, the following example performs a task every minute:
*/1 * * * */usr/bin/php/users/huangyibiao/desktop/shell/test.php >>/users/huangyibiao/desktop/shell/test.log
Common commands
To view the list of tasks in the current crontab file:
Crontab-l
If you want to suspend the task, simply comment out the task!
Go to the Crontab task List to edit:
Crontab-e
E is the meaning of edit!
Example
Execute */5 * * * * every five minutes
0 per hour * * * * * *
Daily Execution 0 0 * * *
Perform 0 0 * * 0 per week
0 0 1 * * * per month
Annual Implementation 0 0 1 1 *
Example
The above example shows the 21:30 restart Apache per night
* * * */usr/local/apache/bin/apachectlrestart
The above example represents the 4:45 restart Apache for 1, 10, and 22nd per month
4 1,10,22 * */usr/local/apache/bin/apachectlrestart
The above example shows that every Saturday, Sunday, 1:10 restart Apache
1 * * 6,0/usr/local/apache/bin/apachectlrestart
The example above shows the restart of Apache every 30 minutes from 18:00 to 23:00 every day.
0,30 18-23 * * * */usr/local/apache/bin/apachectlrestart
The above example shows the 11:00 pm reboot Apache every Saturday
0 * * 6/usr/local/apache/bin/apachectlrestart
Restart Apache every hour
* */1 * * * */usr/local/apache/bin/apachectlrestart
From 11 o'clock to 7 in the morning, restart Apache every hour.
* 23-7/1 * * * */usr/local/apache/bin/apachectlrestart
4th per month with 11 points per Monday to Wednesday restart Apache
0-4 * mon-wed/usr/local/apache/bin/apachectlrestart
Restart Apache at 4 o ' January 1.
0 4 1 jan*/usr/local/apache/bin/apachectlrestart