Run cron job only if it isn't already running

后端 未结 16 961
执笔经年
执笔经年 2020-11-29 14:53

I\'m trying to set up a cron job as a sort of watchdog for a daemon that I\'ve created. If the daemon errors out and fails, I want the cron job to periodically restart it...

16条回答
  •  忘掉有多难
    2020-11-29 15:22

    I would recommend to use an existing tool such as monit, it will monitor and auto restart processes. There is more information available here. It should be easily available in most distributions.

提交回复
热议问题