-
-
Save KieranHayes/374b08fb8d4a9cea7701 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set_path="cd /home/rails/my_app/current" | |
case "$1" in | |
start) | |
echo -n "Starting delayed_job: " | |
su - rails -c "$set_path; RAILS_ENV=production script/delayed_job start" >> log/delayed_job.log 2>&1 | |
echo "done." | |
;; | |
stop) | |
echo -n "Stopping delayed_job: " | |
su - rails -c "$set_path; RAILS_ENV=production script/delayed_job stop" >> log/delayed_job.log 2>&1 | |
echo "done." | |
;; | |
*) | |
N=/etc/init.d/delayed_job | |
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