diff --git a/lib/tasks/dev.rake b/lib/tasks/dev.rake index 1a7b21198..c0bc7b01c 100644 --- a/lib/tasks/dev.rake +++ b/lib/tasks/dev.rake @@ -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"