Skip to content

Instantly share code, notes, and snippets.

@blasterpal
Created October 4, 2012 14:52
Show Gist options
  • Select an option

  • Save blasterpal/3834051 to your computer and use it in GitHub Desktop.

Select an option

Save blasterpal/3834051 to your computer and use it in GitHub Desktop.
Pull DB Backup from Engine Yard Ver 2
#This version is non-interactive. Just put in your bucket in file in same dir.
bucket = `cat prodbucket.txt`.strip
list = `sudo /usr/local/ey_resin/bin/eybackup -l BAM -e mysql -b #{bucket}`
#puts list.split("\n")
#exit
latest_file = list.split('\n').first.split("\n").select{|ea| ea =~ /^[0-9]*:/}.last
latest_index = latest_file.split(":").first
puts "Downloading #{latest_file}"
`sudo /usr/local/ey_resin/bin/eybackup -e mysql -d #{latest_index}:BAM -b #{bucket}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment