Skip to content

Instantly share code, notes, and snippets.

@sandipransing
Created February 4, 2011 10:10
Show Gist options
  • Select an option

  • Save sandipransing/810950 to your computer and use it in GitHub Desktop.

Select an option

Save sandipransing/810950 to your computer and use it in GitHub Desktop.
delayed_job
#! /bin/sh
set_path="cd /home/josh/current"
case "$1" in
start)
echo -n "Starting delayed_job: "
su - root -c "$set_path; RAILS_ENV=production script/delayed_job start" >> /var/log/delayed_job.log 2>&1
echo "done."
;;
stop)
echo -n "Stopping delayed_job: "
su - root -c "$set_path; RAILS_ENV=production script/delayed_job stop" >> /var/log/delayed_job.log 2>&1
echo "done."
;;
*)
echo "Usage: $N {start|stop}" >&2
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment