Hi, thanks for taking the time to read my article. Visit aaronvb.com for more reads, and contact me below if you have questions.

AARON VAN BOKHOVEN

You can find me on GitHub, Twitter, Instagram, Flickr, or email at bokhoven@gmail.com

Recurring delayed_job with cron

Written Aaron Van Bokhoven on Oct 27, 2010

Do you need a delayed_job job to happen at certain times or intervals?

This one is easy and I use it quite often - particularly to scrape data at certain times during the day, and generate nightly statistics and reports.

Why would I use delayed_job to handle recurring jobs over rake task? Every time a rake task is issued, a new rails instance is spawned which takes time and memory to start and run. If a delayed_job daemon is already running, using that will save both. In my opinion, running a rake task that uses the rails environment is usually very costly in production and should be avoided if possible.