Scheduled task execution php file problems

Source: Internet
Author: User
A. php file, and write a bat, the content is: C: \ wamp \ bin \ php \ php5.3.8 \ php.exe-fE: \ photoselect \ work \. php regularly executes bat in the task plan. if it is set to execute once every 5 minutes, but usually 5 minutes is not enough, it will run another bat five minutes later.
I wrote a. php file,
I wrote another bat with the following content:
C: \ wamp \ bin \ php \ php5.3.8 \ php.exe-f E: \ photoselect \ work \ a. php

Execute bat in a scheduled task and set it to be executed once every 5 minutes.

However, it often fails to be processed in five minutes. after five minutes, another bat task will be run, which may cause an error,
(The task has not been completed when it has been set in the scheduled task, but the new instance does not exist .)

Thank you for your help.

------ Solution --------------------
After five minutes, you can only find a way to improve efficiency of a. php. check the bottleneck and consider multithreading.


In addition, you cannot afford to launch new instances. it is for bat. in php, you need to implement duplicate process detection on your own.
------ Solution --------------------
Modify the file running in a. php to determine whether the file is still running. If yes, exit directly. If no, the destroy mark is terminated.

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.