summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/capistrano/tasks/db.rake (renamed from lib/capistrano/tasks/postgresql.rake)3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/capistrano/tasks/postgresql.rake b/lib/capistrano/tasks/db.rake
index 09257e28..61c80a69 100644
--- a/lib/capistrano/tasks/postgresql.rake
+++ b/lib/capistrano/tasks/db.rake
@@ -1,6 +1,6 @@
set(:postgresql_host, "localhost")
-namespace :postgresql do
+namespace :db do
desc "Backup the database and copy it locally"
task :backup do
filename = "#{fetch(:rails_env)}-#{Time.now.strftime('%Y-%m-%d-%H-%M')}.dump"
@@ -10,6 +10,7 @@ namespace :postgresql do
execute "mkdir -p #{shared_path}/backups"
execute "PGPASSWORD='#{fetch(:postgresql_password)}' pg_dump -Fc --no-acl --no-owner -h #{fetch(:postgresql_host)} -U deployer cakeside > #{backup_path}/#{filename}"
download!("#{backup_path}/#{filename}", "db/backups/", :via => :scp)
+ execute "s3cmd sync #{shared_path}/backups/*.dump s3://cakeside-logs/#{fetch(:rails_env)}/pg/"
end
end
end