0
我在使用rails中的備份gem備份數據庫時遇到了問題。在rails中使用gem「backup」備份數據庫
這是我daily_db_backup.rb
Model.new(:daily_db_backup, 'Description for daily_db_backup') do
database SQLite do |db|
db.path = "home/ec2-user/project/db/production.sqlite3"
db.sqlitedump_utility = "/usr/bin/sqlite3"
end
compress_with Gzip
store_with S3 do |s3|
s3.access_key_id = "my_key_id"
s3.secret_access_key = "my_access_key"
s3.region = 'ap-northeast-2'
s3.bucket = 'project'
s3.path = 'home/ec2-user/project/db/production.sqlite3'
end
notify_by Mail do |mail|
mail.on_success = true
mail.on_warning = true
mail.on_failure = true
mail.delivery_method = :sendmail
mail.from = "[email protected]"
mail.to = "[email protected]"
end
end
,這些都是錯誤信息
[error] Model::Error: Backup for Description for daily_db_backup (daily_db_backup) Failed!
[error] --- Wrapped Exception ---
[error] Database::SQLite::Error: Database::SQLite Dump Failed!
[error] Pipeline STDERR Messages:
[error] (Note: may be interleaved if multiple commands returned error messages)
[error]
[error] Error: unable to open database "home/ec2-user/project/db/production.sqlite3": unable to open database file
[error] The following system errors were returned:
[error] Errno::EPERM: Operation not permitted - 'echo' returned exit code: 1
那麼,如何解決這個問題呢?