Commit d89434517dff21b4fd682bd926d6279fe01cc77e

Authored by Antonio Terceiro
1 parent 014031e1

backup/restore: default `host` to localhost

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
lib/tasks/backup.rake
@@ -25,7 +25,7 @@ task :backup => :check_backup_support do @@ -25,7 +25,7 @@ task :backup => :check_backup_support do
25 dump = File.join('tmp/backup', backup_name) + '.sql' 25 dump = File.join('tmp/backup', backup_name) + '.sql'
26 26
27 database = $config['production']['database'] 27 database = $config['production']['database']
28 - host = $config['production']['host'] 28 + host = $config['production']['host'] || 'localhost'
29 sh "pg_dump -h #{host} #{database} > #{dump}" 29 sh "pg_dump -h #{host} #{database} > #{dump}"
30 30
31 sh 'tar', 'chaf', backup_file, dump, *dirs 31 sh 'tar', 'chaf', backup_file, dump, *dirs
@@ -82,7 +82,7 @@ task :restore => :check_backup_support do @@ -82,7 +82,7 @@ task :restore => :check_backup_support do
82 82
83 database = $config['production']['database'] 83 database = $config['production']['database']
84 username = $config['production']['username'] 84 username = $config['production']['username']
85 - host = $config['production']['host'] 85 + host = $config['production']['host'] || 'localhost'
86 86
87 puts "WARNING: backups should be restored to an empty database, otherwise" 87 puts "WARNING: backups should be restored to an empty database, otherwise"
88 puts "data from the backup may not be loaded properly." 88 puts "data from the backup may not be loaded properly."