File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 389389# Backup commands (for all databases) for the various database flavours...
390390BACKUP_COMMANDS = {
391391 FLAVOUR_POSTGRESQL : 'pg_dumpall --username=%s --no-password --clean --if-exists'
392+ ' --no-comments'
393+ ' --exclude-database=template1'
394+ ' --exclude-database=postgres'
392395 ' | gzip > %s' % (PGUSER , BACKUP )
393396}
394397# Backup commands (for a single database).
395398# Check comments above in case they're relevant here.
396399BACKUP_COMMANDS_ONE_DB = {
397- FLAVOUR_POSTGRESQL : 'pg_dump --username=%s --no-password --clean --if-exists %s '
398- ' | gzip > %s' % (PGUSER , DATABASE , BACKUP )
400+ FLAVOUR_POSTGRESQL : 'pg_dump --username=%s --no-password --clean --if-exists'
401+ ' --no-comments %s | gzip > %s' % (PGUSER , DATABASE , BACKUP )
399402}
400403
401404# What 'flavour' of database do we expect to be backing up?
Original file line number Diff line number Diff line change @@ -631,12 +631,16 @@ def error(error_no):
631631# Remove any files we may have created.
632632RECOVERY_FILE = "%s/%s.sql" % (RECOVERY_ROOT_DIR , DECOMPRESSED_RECOVERY_NAME )
633633FILTERED_FILE = "%s/%s.sql" % (RECOVERY_ROOT_DIR , DECOMPRESSED_FILTERED_NAME )
634+ OUTPUT_FILE = "%s/sql.out" % RECOVERY_ROOT_DIR
634635if os .path .isfile (RECOVERY_FILE ):
635636 print ('--] Removing %s' % RECOVERY_FILE )
636637 os .remove (RECOVERY_FILE )
637638if os .path .isfile (FILTERED_FILE ):
638639 print ('--] Removing %s' % FILTERED_FILE )
639640 os .remove (FILTERED_FILE )
641+ if os .path .isfile (OUTPUT_FILE ):
642+ print ('--] Removing %s' % OUTPUT_FILE )
643+ os .remove (OUTPUT_FILE )
640644
641645# Success if we get here
642646write_termination_message ()
You can’t perform that action at this time.
0 commit comments