Created
April 15, 2012 07:49
-
-
Save torkale/2390771 to your computer and use it in GitHub Desktop.
download latest backup from S3
This file contains hidden or 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
| require 'rubygems' | |
| require 'fog' | |
| connection = Fog::Storage.new(:provider => 'AWS') | |
| directory = connection.directories.find{|dir| dir.key == ENV['BUCKET_KEY']} | |
| file = directory.files.last | |
| File.open ENV['BACKUP_FILE'], 'w' do |backup| | |
| backup << file.body | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment