Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

123 lines (77 sloc) 3.86 KB


A Backup Ruby Gem

Backup is a Ruby Gem written for Unix and Ruby on Rails (2 and 3) environments. It can be used both with and without the Ruby on Rails framework! This gem offers a quick and simple solution to backing up databases such as MySQL/PostgreSQL/SQLite and Files/Folders. All backups can be transferred to Amazon S3, Rackspace Cloud Files, Dropbox Web Service, any remote server you have access to (using either SCP, SFTP or regular FTP), or a Local server. Backup handles Compression, Archiving, Encryption, Backup Cleaning (Cycling) and supports Email Notifications.

Written for Environments

  • UNIX (Ubuntu, OSX, etc.)
  • Ruby on Rails 3
  • Ruby on Rails 2



Backup's Current Capabilities

Storage Methods

  • Amazon S3
  • Rackspace Cloud Files
  • Dropbox (Using your API key/secret from
  • Remote Server (Available Protocols: SCP, SFTP, FTP)
  • Local server (Example Locations: Another Hard Drive, Network path)


  • MySQL
  • PostgreSQL
  • SQLite
  • MongoDB
  • Archive (Any files and/or folders)
  • Custom (Anything you can produce using the command line)


Handles archiving for the Archive and Custom adapters.


Handles encryption of all backups for any adapter. To decrypt a "Backup encrypted file" you can use Backup's built-in utility command:

sudo backup --decrypt /path/to/encrypted/file.enc

Backup Cleaning

With Backup you can very easily specify how many backups you would like to have stored (per backup procedure!) on your Amazon S3, Remote or Local server. When the limit you specify gets exceeded, the oldest backup will automatically be cleaned up.

Email Notifications

You will be able to specify whether you would like to be notified by email when a backup successfully been stored. Simply fill in the email configuration block and set "notify" to true inside the backup procedure you would like to be notified of.

Quick Example of a Single Backup Setting/Procedure inside the Backup Configuration File

backup 'mysql-backup-s3' do
  adapter :mysql do
    user      'user'
    password  'password'
    database  'database'
  storage :s3 do
    access_key_id     'access_key_id'
    secret_access_key 'secret_access_key'
    host              ''
    bucket            '/bucket/backups/mysql/'
    use_ssl           true
  keep_backups 25
  encrypt_with_password 'my_password'
  notify true

Everything above should be pretty straightforward, so now, using the trigger we specified between the backup and do you can execute this backup procedure like so:

Rails Environment

rake backup:run trigger=mysql-backup-s3

Unix Environment

sudo backup --run mysql-backup-s3

That's it. This was a simple example of how it works.

Want to take Backup for a spin?

Wiki Pages

Check out our (15) helpful wiki pages


If anyone has any requests, please send us a message or post it in the issue log!


Send us a message! Fork the project!

Found a Bug?

Report it

Michael van Rooijen | Final Creation. (

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