I have a Django commend "script" that i running every 20 second
like this:: (only shows part of it, and works fine ;))
* * * * * /manage.py btupdate
* * * * * sleep 20; /manage.py btupdate
* * * * * sleep 40; /manage.py btupdate
My problem is that the "command script" sometimes may take more than 20 sec. to execute, and I don't want to start another job before the last job has stopped.
How to solve that? ;)
You can use file as indicator of work. (maybe you can use process id too, but solution with file is simple enought)
in bash:
if [ ! -f /tmp/iam_working ] ; then touch /tmp/iam_working; yourcommands; rm /tmp/iam_working; fi