Я использую Amazon S3 для резервного копирования базы данных MySQL моего Rails-приложения. И я использую плагин astrails-safe для этого, и я получаю сообщение об ошибке «Ваш предыдущий запрос на создание именованного сегмента успешно выполнен, и вы уже им владеете. (AWS :: S3 :: BucketAlreadyOwnedByYou)» при попытке обновить его.
Я проверил, что папка, в которую я хочу сделать резервную копию, уже есть в моей учетной записи. Просто я не могу загрузить файлы из кода (используя astrails-safe).
ки. Когда я запускаю этот код
sudo astrails-safe
/Users/pww/sites/web_apps/myapp/trunk/lib/backup/local.rb
, я получил следующую ошибку.
/opt/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/error.rb:38:in `raise': Your previous request to create the named bucket succeeded and you already own it. (AWS::S3::BucketAlreadyOwnedByYou)
from /opt/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/base.rb:72:in `request'
from /opt/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/base.rb:88:in `put'
from /opt/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/bucket.rb:79:in `create'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/s3.rb:29:in `save'
from /opt/local/lib/ruby/1.8/benchmark.rb:308:in `realtime'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/s3.rb:28:in `save'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/sink.rb:8:in `process'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/backup.rb:15:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/backup.rb:12:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/backup.rb:12:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe.rb:53:in `safe'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/config/node.rb:51:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/config/node.rb:51:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe.rb:52:in `safe'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe.rb:46:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe.rb:46:in `safe'
from /Users/phyowaiwin/sites/web_apps/myapp/trunk/lib/backup/local.rb:1
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/bin/astrails-safe:50:in `load'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/bin/astrails-safe:50:in `main'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/bin/astrails-safe:53
from /opt/local/bin/astrails-safe:19:in `load'
from /opt/local/bin/astrails-safe:19
Код в local.rb следующий.
safe do
local do
path "/backup/:kind"
end
s3 do
key "mykey"
secret "mysecret"
bucket "myapp-local-backup"
path ":kind/:id" # this is default
end
keep do
local 100
s3 100
mysqldump 100
end
# backup mysql databases with mysqldump
mysqldump do
# you can override any setting from parent in a child:
options "-ceKq --single-transaction --create-options"
user "root"
password ""
# host "localhost"
# port 3306
socket "/tmp/mysql.sock"
database :myapp_development
end
tar do
options "-h" # uncomment this to dereference symbolic links
archive "myapp-local-com" do
files "~/sites/web_apps/myapp/branches"
end
end
end
Буду признателен за любую помощь!
Спасибо.