Dear Experts,
I have a script defined in Cron which runs every 1 minute.
Code:
* * * * * /export/home/myscript.sh >/dev/null 2>&1
Now the issue is executing that myscript.sh sometime will take 2/3 or more minutes to finish execution.
But after 1 minute cron will invoke another instance(process) execute the myscript. In that case do you think there is a probability to overlapping the instance and may create problem.
If there is a chance for overlapping may be the below shellscript(run it in background) is okay which will run every 1 minute. Script will invoke different instant after every minute.
Code:
#!/usr/bin/bash
while :
do
sleep 60 & pid=$!
/export/home/myscript.sh
wait $pid
done
Could you please make your valuable suggestion?
//purple