Merge pull request #1983 from betagouv/improve-import-db
Do not download backup if exists
This commit is contained in:
commit
a872acfb97
1 changed files with 4 additions and 1 deletions
|
@ -71,7 +71,10 @@ namespace :dev do
|
||||||
task :import_db do
|
task :import_db do
|
||||||
filename = "tps_prod_#{1.day.ago.strftime("%d-%m-%Y")}.sql"
|
filename = "tps_prod_#{1.day.ago.strftime("%d-%m-%Y")}.sql"
|
||||||
local_file = "/tmp/#{filename}"
|
local_file = "/tmp/#{filename}"
|
||||||
|
|
||||||
|
if !File.exist?(local_file)
|
||||||
run_and_stop_if_error "scp -C deploy@sgmap_backup:/var/backup/production1/db/#{filename} #{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"
|
dev_env_param = "RAILS_ENV=development"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue