Normally that would be a good solution. Unfortunately, this script does the following:
- Read in a (possibly) very large file and process it.
- Process and plot data every minute.
The data from phase 1 is needed in phase 2. I actually plan on running the script from init... | [reply] |
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.
| [reply] |