Use PHP and Windows Task Scheduler to try again on exit(1) -


I use the Windows Task Scheduler to start a php script which works perfectly well. Basically the c: \ php.exe -f c: \ myscript.php

There is some work in my script which sometimes I will be working again in 5 minutes Wants to run

I changed the effect of the work and tried to implement it to restart every 5 minutes, if the function fails and my php code exit (1) to the task scheduler I know I get out of an error code of 1, but it does not run the script again.

Does anyone know what I can do to do this so that the task manager will try again for 5 minutes if I signal it with my code in any way.

Can not work in the answer to the question, but can work as a fallback if you do not work it : In any database or file, run your job every 5 minutes, even if anyone, and then track the "last success" / "last failure" > Before doing anything, the script can check the log's status, and if the last time had a failure, then try again (possibly due to limited efforts) if the last time was successful, Get out, until the time for the next job (as if the original schedule was daily, then check for $ last_success more than 24 hours in advance).

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -