I am writing a php script that will go through cron. Its task is to call other php scripts. Called scripts can also be executed externally. I want that although one file is being executed, it should not be running at the same time. To make everything clear, consider the following
Suppose there is one script master.php that calls two other scripts, script1.php and script2.php, one after the other. Now, as soon as it is called script1.php, it starts execution and takes 10 minutes to complete the processing. This Script1.php can also be started by the user separately during these 10 minutes.
What I want to do while this script is in the middle of its processing, it should not be executed only in parallel.
Is there any way to achieve this? (Perhaps by checking the PID of the script 1.php).
Thanx in advance.
source
share