Keep your rake running

Keep your rake running

To keep your rake process running, you can monitor and start it using god(a process monitoring framework)

Install the god using the following command

$ [sudo] gem install god 
 
 
create a directory 
 
create a file with filename.god  Put the below code


 
 1 God.watch do |w|
  2   w.dir = "/rails/root/directory/path/"
  3   w.name = "rakewatch"
  4   w.start = "rake jobs:work"
  5   w.keepalive
  6 end
 
 To have the process running in the background issue the following command.


god -c filename.god -D

This will monitor the rake task and start it if its not running.