Skip to content

Instantly share code, notes, and snippets.

@pkarman
Created June 11, 2015 14:44
Show Gist options
  • Select an option

  • Save pkarman/050f988028a01e45a769 to your computer and use it in GitHub Desktop.

Select an option

Save pkarman/050f988028a01e45a769 to your computer and use it in GitHub Desktop.
#!/bin/sh
export $(cat .env | grep -v ^# | xargs)
bundle exec rake say_when:start --trace 2>&1 >> log/say_when.log &
#nohup bundle exec rake say_when:start 2>&1 >> log/say_when.log &
echo $! > tmp/pids/say_when.pid
@kookster
Copy link
Copy Markdown

Here is the god script template I am using in production:

God.watch do |w|
  w.dir = "<%= @params[:dirname] %>"
  w.env = {"RAILS_ENV" => "<%= @params[:environment] %>"}
  w.name = "<%= @name %>"
  w.group = "<%= @name %>_group"
  w.start = "bundle exec rake say_when:start --trace"
  w.log = "<%= @params[:dirname] %>/log/scheduler.output"
  w.uid = "fixer"
  w.gid = "fixer"
  w.keepalive
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment