A rails plugin to backup Mysql to Amazon S3
Ruby
Permalink
Failed to load latest commit information.
lib Need to explicitly catch LoadError Oct 22, 2010
rails
spec Remove db2s3:metrics task for the moment because it's horribly wrong … Dec 6, 2009
tasks
.gitignore
HISTORY Version bump to 0.3.1 Dec 6, 2009
README.rdoc Add note about db2fog in the README. Jul 23, 2011
Rakefile
VERSION Version bump to 0.3.2 Oct 22, 2010
db2s3.gemspec
init.rb Gemify Mar 8, 2009

README.rdoc

DB2S3

A rails plugin to backup Mysql to Amazon S3. You're looking at a monthly spend of four cents. So pony up you cheap bastard, and store your backups on S3

This gem is unmaintained

I don't use this gem anymore so cannot maintain it. There is a newer, shinier alternative called db2fog which supports many different backends, not just S3, and doesn't rely on the aws-s3 gem which is a bit crufty:

github.com/yob/db2fog

You should use that rather than this.

Usage

# In config/environment.rb
config.gem "db2s3", :source => "http://gemcutter.org"

# In Rakefile
require 'db2s3/tasks'

# In config/initializers/db2s3.rb
DB2S3::Config.instance_eval do
  S3 = {
    :access_key_id     => 'yourkey',
    :secret_access_key => 'yoursecretkey',
    :bucket            => 'yourapp-db-backup'
  }
end
# DB credentials are read from your rails environment

rake gems:install

# Add to your crontab or whatever
rake db2s3:backup:full
rake db2s3:backup:incremental # Unimplemented

# Handy tasks
rake db2s3:statistics      # Shows you the size of your DB
rake db2s3:backup:restore  # You should be testing this regularly
rake db2s3:backup:clean    # Clean up old backups - cron this

Development

Specs are really week. This code is bit hackish but is being used by quite a few people.

Kudos

github.com/pauldowman/blog_code_examples/tree/master/mysql_s3_backup