INCLUDE_DATA

Article written

  • on 04.08.2005
  • at 10:09 PM
  • by Rory

Nightly Maintenance for Ruby on Rails Apps 2

Aug4

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.

Are there any “gotchas” that I should be weary of when following this process?

subscribe to comments RSS

There are 2 comments for this post

  1. 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…

  2. Rory says:

    Thanks Mikkel. That’s great news to here.

Please, feel free to post your own comment

* these are required fields