Which options can i use in "flock" to stop multiple script executions.
Actually in my script im using as below:
(
flock -x -w 300 200 || ( echo "[ERROR] Could not reserve lock" && exit 1 )
# My code(Script to take backup)
) 200>/tmp/myscript.lock
In my cron i have written like it should execute for every one hour. So, when my script is running and taking some time to execute, after some time it is allowing cron to run script after an hour even the old script did not complete execution.
So, is there any way that after one hour if the script doesn't complete, it should wait until it is completed and then run another script.
|