Do not download backup if exists

This commit is contained in:
Mathieu Magnin 2018-05-29 16:52:30 +02:00 committed by gregoirenovel
parent e6e8a95ca3
commit 2f5e02c90e

View file

@ -71,7 +71,10 @@ namespace :dev do
task :import_db do
filename = "tps_prod_#{1.day.ago.strftime("%d-%m-%Y")}.sql"
local_file = "/tmp/#{filename}"
run_and_stop_if_error "scp -C deploy@sgmap_backup:/var/backup/production1/db/#{filename} #{local_file}"
if !File.exist?(local_file)
run_and_stop_if_error "scp -C deploy@sgmap_backup:/var/backup/production1/db/#{filename} #{local_file}"
end
dev_env_param = "RAILS_ENV=development"