On 06/06/2012 11:17 AM, Peter Hickman wrote:
> If the script needs to be run periodically (once a day or hour or
> minute perhaps) then something like the unix utility cron would be of
> interest, if your script sleeps for any amount of time then cron is
> probably the way to go. It's installed on unix boxes by default.
>
> If the script needs to be run continuously then a tool like monit
> (which you would have to install) would be worth looking at. It will
> keep the script running even if it crashes, it will just restart it if
> things go wrong and make sure that it starts when your sever reboots.
>
> Or you could just write a script for /etc/init.d that launches your
> script at boot time and pray that it never crashes (which is why I
> would recommend monit).

init has the "respawn" keyword for keeping scipts running even if they chrashed
afaik init is designed to keep things running, not only for strting things at boot time.

There is a description on this in the "Linux Server Hacks": 
http://books.google.de/books?id=mKgomQz5KH0C&printsec=frontcover&source=gbs_ge_summary_r&cad=0#v=onepage&q&f=false

watch out for hack#4


regards
ralf