I have configured my webservers cron jobs to trigger some PHP script, every 15min, but sometimes the script takes more than 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 (don't 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 can't 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 are run parallel (but same instances can't).