On 12/28/07, Christopher Beland beland@alum.mit.edu wrote:
Wouldn't a cronjob give the same effect?
If you have a script that runs, say, on the hour, one benefit of doing a loop instead of a cron job is that if your main script unexpectedly fails to exit, or takes longer than an hour to execute, you don't end up creating a large number of copies of the same script on the machine.
You can also add a simple check at the beginning looking for duplicate copies running on the same machine, and take appropriate action (either dying, or killing it, whichever you prefer). There's not much need to reinvent cron, either way.