lib/eycap/recipes/database.rb in engineyard-eycap-0.4.12 vs lib/eycap/recipes/database.rb in engineyard-eycap-0.4.14

- old
+ new

@@ -34,11 +34,11 @@ end run "bzcat #{backup_file}.bz2 | psql -W -U #{dbuser} -h #{staging_dbhost} #{staging_database}" do |ch, stream, out| ch.send_data "#{dbpass}\n" if out=~ /^Password/ end end - run "rm -f #{backup_file}" + run "rm -f #{backup_file}.bz2" end desc "Backup your MySQL or PostgreSQL database to shared_path+/db_backups" task :dump, :roles => :db, :only => {:primary => true} do backup_name @@ -58,15 +58,15 @@ desc "Sync your production database to your local workstation" task :clone_to_local, :roles => :db, :only => {:primary => true} do backup_name dump - get "#{backup_file}.bz2", "/tmp/#{application}.sql.gz" + get "#{backup_file}.bz2", "/tmp/#{application}.sql.bz2" development_info = YAML.load_file("config/database.yml")['development'] if development_info['adapter'] == 'mysql' - run_str = "bzcat /tmp/#{application}.sql.gz | mysql -u #{development_info['username']} --password='#{development_info['password']}' -h #{development_info['host']} #{development_info['database']}" + run_str = "bzcat /tmp/#{application}.sql.bz2 | mysql -u #{development_info['username']} --password='#{development_info['password']}' -h #{development_info['host']} #{development_info['database']}" else - run_str = "PGPASSWORD=#{development_info['password']} bzcat /tmp/#{application}.sql.gz | psql -U #{development_info['username']} -h #{development_info['host']} #{development_info['database']}" + run_str = "PGPASSWORD=#{development_info['password']} bzcat /tmp/#{application}.sql.bz2 | psql -U #{development_info['username']} -h #{development_info['host']} #{development_info['database']}" end %x!#{run_str}! end end