Rails 怎样让某个 rake 任务在 CentOS 后台跑

frankel · March 09, 2012 · Last by frankel replied at March 09, 2012 · 4708 hits

问题如标题,请教大家

具体是什么样的任务呢?有很多种方案的,如果是和应用相关的,推荐 Resque,https://github.com/bvandenbos/resque-schedulerbash脚本也可以。。如果和应用关系不大,写

是 Resque 服务,rake resque:work QUEUE='*'

#2 楼 @frankel 那服务器的类型呢?如果可以远程登录,直接到服务器上跑起来就可以了。

resque-scheduler 自身怎么在后台跑? 版本 1.9.9,使用 background=yes 参数也不能放在后台 resque1.20 可以后台运行了

@suupic 我是参照这个来配的,http://railscasts.com/episodes/271-resque @sunzheng91 服务器(Centos)上是可以跑,但是不能像在后面加 -D,所以这个窗口就不能关了。

#5 楼 @frankel 试一下用 nohup 来跑,关于 nohup 你可以 Google 一下

@sunzheng91 搞定了,多谢!

nohup rake resque:work &

You need to Sign in before reply, if you don't have an account, please Sign up first.