Ubuntu stop using crontab execute PHP code

Source: Internet
Author: User
Using Crontab to execute PHP code under Ubuntu
Wangking wrote

In the development of the Web site will inevitably encounter the timing of the execution of PHP code, PHP does not have a timer like Java, so can only be replaced with crontab.

?

? ? Edit the crontab file to see the specific writing specifications, very convenient (vim/etc/crontab):

?

??? is the following writing specification:

# 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) 6    * * 7   root    test-x/usr/sbin/anacron | | (CD/&& run-parts--report/etc/cron.weekly) 6    1 * *   root    test-x/usr/sbin/anacron | | (CD/&& run-parts--report/etc/cron.monthly) #

?

? ? So I'm going to execute my PHP code every minute, which I can write according to the specification:

? ??

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

?

? ? PHP code is executed daily:

* * * Root wget-q-o/dev/null http://www.rewufeng.com/

?

? ? Another crontab of detailed writing specifications can be consulted:http://hi.baidu.com/michaelxdt/item/a8e4fec22a59867388ad9e62

?

? ? It's done.

?

?

  • 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.