Ubuntu stops using crontab to execute php code

Source: Internet
Author: User
Using crontab in Ubuntu to execute php code wangking writes that in website development, php code will inevitably be executed on a regular basis. php does not have a timer like java, so it can only be replaced by crontab .??? Edit the crontab file to view the specific writing specifications. it is very convenient (vimetccrontab ):???? The writing rules are as follows: # execute php code using crontab in mhdommondowuserc Ubuntu

Wangking wrote:

In website development, it is inevitable that php code will be executed regularly. php does not have a timer like java, so it can only be replaced by crontab.

?

? ? Edit the crontab file to view the specific writing specifications (Vim/etc/crontab):

?

? ? ? The writing rules are as follows:

# m h dom mon dow user  command17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )#

?

? ? Then I need to execute my php code every minute, which can be written as follows:

? ??

*/1 * * * * root wget -q -O /dev/null http://www.rewufeng.com/

?

? ? The daily php code execution is:

59 23 * * * root wget -q -O /dev/null http://www.rewufeng.com/

?

? ? For more information about crontab, see: http://hi.baidu.com/michaelxdt/item/a8e4fec22a59867388ad9e62.

?

? ? Complete.

?

?

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.