Skip to content

Commit 4ef19c0

Browse files
author
a.b.christie
committed
fix: Backup now uses --no-comments and --exclude-database=
1 parent 3b0e991 commit 4ef19c0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

sql-backup/backup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,13 +389,16 @@
389389
# Backup commands (for all databases) for the various database flavours...
390390
BACKUP_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.
396399
BACKUP_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?

0 commit comments

Comments
 (0)