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.
Ruby-on-rails – A cron job for rails: best practices
crondaemonrakeruby-on-railsrunner
Related Topic
- Linux – How to get a cron job to run every 30 minutes
- Ruby-on-rails – Do rails rake tasks provide access to ActiveRecord models
- Ruby-on-rails – How to make a column unique and index it in a Ruby on Rails migration
- Ruby-on-rails – Rails: How to rename a database column in a Ruby on Rails migration
- Ruby-on-rails – Rails: How to run `rails generate scaffold` when the model already exists
- Ubuntu – Running a cron every 30 seconds
- Run Cron job every N minutes plus offset
Best Answer
I've used the extremely popular Whenever on projects that rely heavily on scheduled tasks, and it's great. It gives you a nice DSL to define your scheduled tasks instead of having to deal with crontab format. From the README:
Example from the README: