What’s the best way to run scheduled tasks in a Rails environment? Script/runner? Rake? I would like to run the task every few minutes.
What’s the best way to run scheduled tasks in a Rails environment? Script/runner? Rake?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m using the rake approach (as supported by heroku)
With a file called lib/tasks/cron.rake ..
To execute from the command line, this is just “rake cron”. This command can then be put on the operating system cron/task scheduler as desired.
Update this is quite an old question and answer! Some new info: