Improve grep pattern in restorer.

This commit is contained in:
Guo Xiang Tan 2018-03-09 15:48:12 +08:00
parent 766b41d9f4
commit 5ef75c9c61
1 changed files with 1 additions and 1 deletions

View File

@ -256,7 +256,7 @@ module BackupRestore
def get_dumped_by_version def get_dumped_by_version
output = Discourse::Utils.execute_command( output = Discourse::Utils.execute_command(
File.extname(@dump_filename) == '.gz' ? 'zgrep' : 'grep', File.extname(@dump_filename) == '.gz' ? 'zgrep' : 'grep',
'-m1', @dump_filename, '-e', "pg_dump", '-m1', @dump_filename, '-e', "-- Dumped by pg_dump version",
failure_message: "Failed to check version of pg_dump used to generate the dump file" failure_message: "Failed to check version of pg_dump used to generate the dump file"
) )