I am using a crontab to execute a php script that retrieves data and writes it to a database. My crontab entry looks like:
* * * * * php /path/to/file/fileName1.php
* * * * * php /path/to/file/fileName2.php
... you get the point
I'd like to use flock to prevent a script from running in the event the previous call hasn't finished.
Each script is writing to a different table in the database and I can't start writing to a table until the previous call has completed execution. Increasing the duration between calls such as: */2 * * * * php /path/to/file/fileName1.php
just won't due to business constraints.