Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (23 sloc) 1014 Bytes

Backup Task

A simple rake task for backing up a Rails 3 application's database using the Backup gem.


Add the gem to your Gemfile.

gem 'backup-task'

Create a backup configuration file in config/backup.rb, with a trigger called db_backup. See for details. Be sure to move the resulting file to config/backup.rb within your Rails app and to name your trigger 'db_backup'.

Once you've done a 'bundle install' you should be able to run the backup task

rake db:backup

This will back up your database according to the configuration in config/backup.rb. It will use the tmp, log, and db directories from your Rails app to avoid conflicting with any other backups happening on the same system.


Bug reports, pull requests, etc are welcome at or you can email the author at


Copyright © 2011 Erik DeBill. See LICENSE.txt for further details.

Jump to Line
Something went wrong with that request. Please try again.