note
rizzo
Hi [redapplesonly]!
<p>You could use a pid file for that. This is, as far as I know, the mechanism commonly used by server software.</p>
<p>At start up, Your script checks if there is already a file with a given name, usually <code>yourscript.pid</code> in a directory, usually <code>/var/run</code>.
If there is one it may read the contents which would be the process id of the already running instance and print an error and exit.</p>.
<p>If there is none, Your script would create yourscript.pid and write its pid to it. Before the script exits, it deletes the file.</p>
11148499
11148499