I found this great post on the Ruby on Rails wiki that shows you how to run background jobs in Rails. Specifically, for the nightly maintenance that I’ll be doing on my website, I’ve chosen to follow the “Use cron or the like to run ruby code” method. There is some example code available on the wiki page that shows you how to access your Rails app from a script.
So far, all I’ve done is use the supplied example code as a base for my maintenance script. I’m in the process of adding the actual “maintenance” code at the moment and, as I do, am testing it by running the script from the command prompt: ruby nightly_maintenance.rb.
NOTE FROM THE AUTHOR, RORY HANSEN
Have you found this post helpful?
If so, I'd appreciate if you could indicate so by pressing the Google Plus button below.
Have you found this post helpful?
If so, I'd appreciate if you could indicate so by pressing the Google Plus button below.
Are there any “gotchas” that I should be weary of when following this process?
Related posts:
2 Comments to “Nightly Maintenance for Ruby on Rails Apps”
Post comment
Recommended Services
Recent Posts
- Fantastic new corporate themes for WordPress
- Vistaprint offers FREE t-shirts, too!
- 80+ “Your Ad Here” 125 x 125 banners
- 5 Minute Long Tail SEO Drill: More Traffic, Better SERPs
- iPhone and iPod Touch app statistics: OS adoption, purchasing rates
Recent Comments
- Neerav on Using JavaScript to validate one or more grouped checkboxes
- Jacob on Using JavaScript to validate one or more grouped checkboxes
- kaify on Using JavaScript to validate one or more grouped checkboxes
- JC Goldenstein on How To: Cloak your Affiliate Links for Free in Under 3 Seconds
- Bail Bonds Los Angeles on Amazon Web Services on Rails
Categories
- .net
- acoustic guitar
- affiliate marketing
- ajax
- amazon associates
- blogging
- books
- business ideas
- c#
- code igniter
- dealdotcom
- google adsense
- google adwords
- internet marketing
- iPhone
- javascript
- leadership
- make money online
- mortgage goal
- msn adcenter
- networking
- personal development
- php
- ppc
- ruby
- ruby on rails
- seo
- text-link-ads
- web development
- yahoo search marketing





mikkel says:
Im doing a lot of background maintenance stuff on a couple of rails based sites…
There is really no gotchas in this, its pretty simple…
But just to so you know…All output from your cron job will be mailed to your user account, which is really good for logging…
Rory says:
Thanks Mikkel. That’s great news to here.