I have a Cron Job scripts which runs every 4 minutes.
In rare cases the script is not finished within 4 minutes.
This causes problems.
How can I perform a check that if there the previous script is not finished then skip the current run
Expected behavior:
10:00 : Script A starts
10:04 : Script A2 starts - it finds that script A was not finish so this script aborts. Simply finish without doing nothing.
10:06 : Script A finish
10:08 : Script A3 starts - no other scripts running so it continue
Notice: A, A2, A3 are the same script (just in different times)! It shouldn't consider other scripts that might be running also