Linux timed php execution

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.