LoginSignup
3
4

More than 5 years have passed since last update.

Rails: run rake task in cron jobs

Posted at

In Rakefile, add this line to the top:

#!/usr/bin/env rake

Run crontab -e to access crontab editor

* * * * * cd /path/to/rails_app; bin/rake some_task

Change the timing, path to your rails app and the rake task that you want to execute.

Read more: http://tutorials.jumpstartlab.com/topics/systems/automation.html
(note: in the tutorial, the author suggests to use full path to rake. I tried but it failed so I just used bin/rake instead)

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4