从heroku自动化amazon rds快照

时间:2011-03-12 09:06:29

标签: ruby heroku rake snapshot amazon-rds

我正在使用amazon rds和heroku应用程序,并希望自动化每日快照。我的目的是安排一个执行快照的rake任务。如何从ruby执行亚马逊rds快照?

1 个答案:

答案 0 :(得分:1)

还没有骰子,但这非常接近:

# Gemfile
source :rubygems

gem 'amazon-ec2'
gem 'rake'


# Rakefile
require 'rubygems'
require 'rake'
require 'AWS'

desc 'create snapshot'
task 'create_snapshot' do
  @rds = AWS::RDS::Base.new(:access_key_id => ACCESS_KEY_ID, 
                            :secret_access_key => SECRET_ACCESS_KEY)
  @rds.create_db_snapshot :db_snapshot_identifier => 'snapshot name',
                          :db_instance_identifier => 'db name'
end

唯一的问题是我收到错误:

Unsupported digest algorithm (sha256).

有什么想法吗?