From 0746b8d5f29f0661cfb5fd4424bbda90bce86720 Mon Sep 17 00:00:00 2001 From: Antonin Januska Date: Mon, 12 May 2014 13:52:49 -0500 Subject: [PATCH 1/2] Fixing a non-delete, double download sync bug --- deployment/lib/sync.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deployment/lib/sync.rb b/deployment/lib/sync.rb index 20226e4..13f59bf 100644 --- a/deployment/lib/sync.rb +++ b/deployment/lib/sync.rb @@ -57,12 +57,11 @@ find_and_execute_task "genesis:backup:db" # Rake::Task["namespace:task"].invoke - download "#{backup_path}.gz", "#{backup_name}.gz", :via => :scp - run "rm -f #{local_backup_dir}/#{backup_path}.gz" - system "gzip -d #{backup_name}.gz" + system "gzip -d #{local_backup_dir}/#{backup_name}.gz" system "vagrant up" - system "vagrant ssh local -c 'cd /vagrant && mysql -uroot < #{backup_name}' && rm -f #{backup_name}" + system "vagrant ssh local -c 'cd /vagrant && mysql -uroot < #{local_backup_dir}/#{backup_name}'" + system "rm -f #{local_backup_dir}/#{backup_name} && rm -f #{local_backup_dir}/#{backup_name}.gz" end desc "Downloads remote files to Vagrant" @@ -131,6 +130,7 @@ system "mkdir -p #{local_backup_dir}" download "#{backup_path}.gz", "#{local_backup_dir}/#{backup_name}.gz", :via => :scp + run "rm -f #{backup_path}.gz" end end end From a1255f407c8d7e137bd0d9d9979dcff11747404e Mon Sep 17 00:00:00 2001 From: Antonin Januska Date: Mon, 12 May 2014 14:02:58 -0500 Subject: [PATCH 2/2] Removed superfluous rm command --- deployment/lib/sync.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/lib/sync.rb b/deployment/lib/sync.rb index 13f59bf..ccf1cf4 100644 --- a/deployment/lib/sync.rb +++ b/deployment/lib/sync.rb @@ -61,7 +61,7 @@ system "vagrant up" system "vagrant ssh local -c 'cd /vagrant && mysql -uroot < #{local_backup_dir}/#{backup_name}'" - system "rm -f #{local_backup_dir}/#{backup_name} && rm -f #{local_backup_dir}/#{backup_name}.gz" + system "rm -f #{local_backup_dir}/#{backup_name}" end desc "Downloads remote files to Vagrant"