From dd85c531827f608f71916b32c7bc3897e479cbe7 Mon Sep 17 00:00:00 2001 From: Emmanuel Nyachoke Date: Wed, 6 Nov 2024 15:06:51 +0000 Subject: [PATCH] Add Clean --- src/restic_compose_backup/containers_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/restic_compose_backup/containers_db.py b/src/restic_compose_backup/containers_db.py index 970dae7..c9b0af7 100755 --- a/src/restic_compose_backup/containers_db.py +++ b/src/restic_compose_backup/containers_db.py @@ -208,7 +208,7 @@ def dump_command_str(self) -> str: """list: create a dump command restic and use to send data through stdin""" # NOTE: Backs up a single database from POSTGRES_DB env var creds = self.get_credentials() - return f"pg_dumpall --host={creds['host']} --port={creds['port']} --username={creds['username']} > {self.backup_destination_path()}" + return f"pg_dumpall --clean --if-exists --host={creds['host']} --port={creds['port']} --username={creds['username']} > {self.backup_destination_path()}" def restore_command_str(self) -> str: """list: create a restore command to restore database dump from restic"""