I want to write a long-running shell script so that only one copy could be run at a time. If the script crashes, I want a new invocation of the script not to be stopped by a lock from the crashed invocation.
lockfile-* set of utils the right thing to use? Is there a chance of a race condition while using them in a script?
--use-pid lift the 5-minutes limitation mentioned on the man page? My scripts run significantly longer.
I use an Ubuntu 10.10 instance on Amazon EC2; no NFS or something like that.