Raghvendra Parashar
Raghvendra Parashar

Reputation: 4053

how can run rake resque:scheduler in daemon mode

I am using resque:scheduler gem in my rails 3 application.

How can start rake resque:scheduler in daemon mode.

and if you know then please let me know,

How can I configure this task in GOD script?

Upvotes: 7

Views: 2266

Answers (4)

aashish
aashish

Reputation: 2603

Try the following to configure resque-schedular in God script.

Install god gem

gem install god

create a file with name as watch.god in your project folder.

Add following to watch.god

God.watch do |w|
  w.name = "resque_schedular"
  w.dir = '/home/machine_name/project_path'
  w.start = "BACKGROUND=yes bundle exec rake environment resque:scheduler"
  w.keepalive
end

Run god in terminal to test

$ god -c path/to/watch.god -D

Run god in daemon(background) from terminal

$ god -c path/to/watch.god

Upvotes: 0

Sachin Singh
Sachin Singh

Reputation: 7225

try this out

rake resque:scheduler BACKGROUND=true

or

rake resque:scheduler &

and now if you want to suppress the output of the rake task try running it with nohup

nohup rake my:task BACKGROUND=true

Upvotes: 0

Raghvendra Parashar
Raghvendra Parashar

Reputation: 4053

PIDFILE=./resque-scheduler.pid BACKGROUND=yes rake resque:scheduler

complete doc of resque scheduler available here

Upvotes: 1

Viren
Viren

Reputation: 5962

I guess you only have to do this

BACKGROUND=yes rake resque:scheduler 

and perhaps that would work check over here

Hope this help

Upvotes: 6

Related Questions