Over a million developers have joined DZone.

Maintenance Of Rails Programs

DZone's Guide to

Maintenance Of Rails Programs

Free Resource
This is a maintenance script, yanked from Lucas Carlson's blog.  Put this in your rails app to have a quick and dirty server maintenance cleanup app:

original at: http://tech.rufy.com/entry/15

pid_file = '/tmp/running.pid'
  File.stat pid_file
  f = File.new pid_file, 'w'
  f < < fork {
    loop {
      # do lots of maintenance
      sleep 15*60

Finally, if your maintenance code needs to be changed, a couple simple commands can restart the new maintenance code:

kill `cat /tmp/running.pid`
rm /tmp/running.pid

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}