Created
April 6, 2011 21:54
-
-
Save eltiare/906623 to your computer and use it in GitHub Desktop.
Bash script to use the Rails' runner action via cron
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/bash | |
cd `dirname $0`/../ | |
rails runner script/${1}.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You use this like so:
/path/to/your/app/script/runthis.sh script-name
I don't like putting the .rb on the end of things, so I made it that way in the script. FWIW, I also drop the .sh extension on the file name on my local projects. Ruby scripts must reside within the script folder.