我想每晚将我的数据库备份存储在我的保管箱帐户中。为此,我正在使用 Backup + Dropbox gem。我的 Ruby 版本是 1.8.7p358 和 Rails 2.3.8,我使用的是 Mysql 数据库。
这是我在控制台中的错误
[2012/10/26 11:25:28][error]ModelError: Backup for My Backup (my_backup) Failed!
[2012/10/26 11:25:28][error] An Error occured which has caused this Backup to abort before completion.
[2012/10/26 11:25:28][error] Please review the Log for this Backup to determine if steps need to be taken
[2012/10/26 11:25:28][error] to clean up, based on the point at which the failure occured.
[2012/10/26 11:25:28][error] Reason: OAuth::Unauthorized
[2012/10/26 11:25:28][error] 401 Unauthorized
这是我的代码
Backup::Model.new(:my_backup, 'My Backup') do
database MySQL do |db|
db.name = "app_development"
db.username = "user"
db.password = "pass"
db.host = "127.0.0.1"
end
store_with Dropbox do |db|
db.api_key = 'nvpsggrunft0'
db.api_secret = '71dvvvdx48hy3'
db.path = '/backups'
db.keep = 80
db.timeout = 443
end
store_with FTP do |server|
server.username = 'aadddn'
server.password = 'tdsddsd'
server.ip = 'Ip Address'
server.port = 21
server.path = ''
server.keep = 30
server.passive_mode = true
end
compress_with Gzip do |compression|
compression.best = true
compression.fast = false
end
notify_by Mail do |mail|
mail.on_success = true
mail.on_failure = true
mail.from = 'xyx@abc.com'
mail.to = 'sumit.munot@cipher-tech.com'
mail.address = 'mail.abc.com'
mail.port = 26
mail.domain = 'abc.com'
mail.user_name = 'abc'
mail.password = 'gvgfgxvxv'
mail.authentication = 'login'
mail.enable_starttls_auto = false
end
end
我在控制台中运行以下命令进行备份
backup perform -t my_backup -c /home/xyz/my_workplace/abc/lib/Backup/config.rb