I have configured my webservers cron jobs to trigger some php script, every 15min, but sometimes the script takes morethan 15 min to complete execution, by the time another process of the same script starts. which is creating problems in our logic. I want only one instance of the same process running, and if it is completed then only let the other process execute(dont want to put process in a queue, just terminate at that moment and execute at next interval).
Example: I have three php file which will be called by the webservers cron job every 15 min. let say a.php, b.php, c.php. the script might take more than 15 min to complete execution. on end of execution it updates our database, hence cant run two copy of same script file(this will break our logic). like say a.php is triggered at 4.00 pm and at 4.15pm again cron will trigger a.php. here i want to check if a.php has completed execution, if not skip the call. and trigger it at 4.30pm by checking the same case. but b.php, c.php and a.php anc run parallel(but same instances cant).