Does anyone use flock? I came across it recently and believe it serves the same purpose, very useful from cron tasks:
man page: http://linux.die.net/man/1/flock
Example: https://ma.ttias.be/prevent-cronjobs-from-overlapping-in-lin...
man page: http://linux.die.net/man/1/flock
Example: https://ma.ttias.be/prevent-cronjobs-from-overlapping-in-lin...
With flock, you're using kernel state, and everything works as expected. Everything is cleared when you reboot, no matter if it's during the cron job or otherwise.