1. Using Crond Service
Crontab-e #编辑任务列表crontab-L #展示任务列表26 * * */usr/local/php70/bin/php-q/data/www/crm/savenum.php
Service Crond Restart (or reload) #重启更新
User Timed Task instance:
|
01 * * * * cmd #每小时的01分钟执行02 04 * * * cmd #每天4点的02分钟执行22 14 * * 00 cmd #每周日的14点22分执行42 04 01 * * cmd #每月1日的4点42分执行
Minute hour day-of-month month-of-year day-of-week commands |
Tips:
1. CMD is the command or script to execute, for example:/bin/sh/server/scripts/chensiqi.sh
2. There must be a space between each column. Can I have more than one space? My own practice ==> by my own test has a number of spaces can also be executed!!
Time Memory formula: The Week of the Moon
The meaning of special symbols in crontab syntax format is as follows table
| Special Symbols |
meaning |
| * |
* Number, means any time, is actually the meaning of "every" |
| - |
The minus sign represents a separator, which represents a time range, an interval segment, such as 17-19 points, for example: 00 minutes of the 17,18,19 point per day to perform the task. XX 17-19 * * * cmd |
| , |
A comma that indicates the meaning of the separating window, for example, 5 o ' 10:00 daily, 5,10 * * * cmd |
| /n |
n represents the number, "every n units of time", for example: every 10 minutes the task can be written as /*10 * * * * cmd, wherein,/10, the range is 0-59, so can also be written 0-59/10 |
Linux timed php execution