public
Fork of xaviershay/db2s3
Description: A rails plugin to backup Mysql to Amazon S3
Homepage:
Clone URL: git://github.com/aiwilliams/db2s3.git
aiwilliams (author)
Fri Apr 10 12:37:10 -0700 2009
commit  c05bd1f71dd5da3080589d16daa5533112340621
tree    2e273d14aee62f21bec3fa52b7ef5cbbc91b5226
parent  a6bdc309a57d16af799c2e401e16a3cc90a31f0b
db2s3 /
name age message
file .gitignore Fri Mar 06 19:14:06 -0800 2009 Initial code [xaviershay]
file README Sat Mar 07 17:50:38 -0800 2009 README update [xaviershay]
file Rakefile Fri Mar 06 19:14:06 -0800 2009 Initial code [xaviershay]
file db2s3.gemspec Sat Mar 07 18:09:10 -0800 2009 Added msising restore task [xaviershay]
file init.rb Sat Mar 07 16:10:39 -0800 2009 Gemify [xaviershay]
directory lib/ Fri Apr 10 12:37:10 -0700 2009 Need to use :username in reading db credentials. [aiwilliams]
directory rails/ Sat Mar 07 17:46:50 -0800 2009 More accurate metrics [xaviershay]
directory spec/ Sat Mar 07 17:46:50 -0800 2009 More accurate metrics [xaviershay]
directory tasks/ Sat Mar 07 18:09:10 -0800 2009 Added msising restore task [xaviershay]
README
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

Usage:
  # In config/environment.rb
  config.gem "xaviershay-db2s3", :lib => "db2s3", :source => "http://gems.github.com"

  # 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:metrics         # Estimated costs
  rake db2s3:backup:restore  # You should be testing this regularly

Caveats:
  Currently only stores the latest backup

Kudos:
  http://github.com/pauldowman/blog_code_examples/tree/master/mysql_s3_backup