in reply to Re: Re: Reasonably accurate timing
in thread Reasonably accurate timing

I recommend mixing solutions.

Run the script from a cron.

However have the script first try to grab a lock, if it can then it is the only copy running so proceed. If it cannot then exit immediately. Basically the same idea as Highlander - allow only one invocation at a time of an expensive CGI script however exiting is to be expected.

I believe that you will find this approach significantly better for dealing with sporadic problems (lost network connections, unexpectedly high load killing a script, needing to move the script and not losing fact of the detail that it is still in init, etc). It does not solve the problem at hand though.

  • Comment on Re (tilly) 3: Reasonably accurate timing