开发者

Monitoring of a Rake Task and Controling it

开发者 https://www.devze.com 2023-03-17 07:29 出处:网络
I would like to get the status of a Rake Task into my backoffice(That means Running or not running). And I also would like to start the rake task if it is not running. Otherwise I want to开发者_运维知

I would like to get the status of a Rake Task into my backoffice(That means Running or not running).

And I also would like to start the rake task if it is not running. Otherwise I want to开发者_运维知识库 quit it.

Any idea?


You can look at this part of a gist: https://gist.github.com/1003601#file_delayed_delta.sh

Basically, I save the PID of the rake task to PIDFILE, then use monit to see if it is running.

https://gist.github.com/1003601#file_monitrc

You could also have a cronjob that runs a system command like ps -ef | grep my_rake_task and see if anything turns up. This may or may not require less effort.

0

精彩评论

暂无评论...
验证码 换一张
取 消