If i have the following entries in my cron table:
00 03 * * * /java_prog1.sh
00 5 * * * /java_prog2.sh
The first job usually takes around 30 minutes to complete. The second job takes about 10 minutes. There are some exceptional situations where the first job takes more than two hours.
Is there a way i can configure the two jobs so that the second job does not start if the first one is still running?
I have seen several examples using tools like flock but i think flock does not apply here as i am not trying to prevent the same job running at the same time. I am trying to prevent another job to start if the previous one is still running.
emit the PID on disk-- it implied write it to a file with a known name.