diff --git a/lib/foreman_maintain/concerns/base_database.rb b/lib/foreman_maintain/concerns/base_database.rb index f6aff6979..1fe46bde0 100644 --- a/lib/foreman_maintain/concerns/base_database.rb +++ b/lib/foreman_maintain/concerns/base_database.rb @@ -73,7 +73,7 @@ def ping(config = configuration) end def dump_db(file, config = configuration) - execute!(dump_command(config) + " > #{file}", :hidden_patterns => [config['password']], :user => config['user']) + execute!(dump_command(config) + " -f #{file}", :hidden_patterns => [config['password']], :user => config['user']) end def restore_dump(file, localdb, config = configuration) @@ -169,9 +169,9 @@ def psql_command(config) def dump_command(config) if config['connection_string'] - "pg_dump -Fc #{config['connection_string']}" + "pg_dump --format=c #{config['connection_string']}" else - base_command(config, 'pg_dump') + " -Fc #{config['database']}" + base_command(config, 'pg_dump') + " --format=c #{config['database']}" end end