Created
May 26, 2011 03:18
-
-
Save STRd6/992483 to your computer and use it in GitHub Desktop.
Backup you db to s3, brah.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :backup do | |
task :database do | |
AWS::S3::Base.establish_connection!( | |
:access_key_id => '123', | |
:secret_access_key => '456' | |
) | |
database = "pixie_production" | |
file = 'dump.sql' | |
`pg_dump #{database} -U postgres > #{file}` | |
AWS::S3::S3Object.store("#{database}_#{Time.now.iso8601}", open(file), 'pixie.strd6.com') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment