From 9876982b70358c462c053f8857e45852cc36143c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <remi@le-filament.com>
Date: Mon, 8 Aug 2022 09:45:34 +0200
Subject: [PATCH] [ENH] backup image and command

---
 templates/backup.yaml.j2  | 6 ++++--
 templates/backup2.yaml.j2 | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/templates/backup.yaml.j2 b/templates/backup.yaml.j2
index 83a8b35..d7424b8 100644
--- a/templates/backup.yaml.j2
+++ b/templates/backup.yaml.j2
@@ -1,7 +1,8 @@
 version: "2.1"
 services:
     backup_mattermost:
-        image: tecnativa/duplicity:postgres
+        image: remifilament/duplicity:postgres # Until https://github.com/Tecnativa/docker-duplicity/pull/324 is merged
+        # image: ghcr.io/tecnativa/docker-duplicity-postgres:master # Once https://github.com/Tecnativa/docker-duplicity/pull/324 is merged
         hostname: {{ inventory_hostname_short | lower | regex_replace('_','') }}-mattermost
         environment:
             DST: "swift://mattermost_{{ inventory_hostname|lower }}"
@@ -16,7 +17,8 @@ services:
             SWIFT_TENANTNAME: "{{ swift_odoo_tenantname }}"
             SWIFT_TENANTID: "{{ swift_odoo_tenantid }}"
             SWIFT_REGIONNAME: "{{ swift_odoo_regionname }}"
-            JOB_300_WHAT: "backup --full-if-older-than 6D"
+            JOB_200_WHEN: "never"
+            JOB_300_WHAT: "pg_dump --no-owner --no-privileges --file $$SRC/$$PGDATABASE.sql && backup --full-if-older-than 6D"
             JOB_302_WHAT: "dup remove-all-but-n-full 5 --force $$DST $$@"
             JOB_302_WHEN: "daily"
         volumes:
diff --git a/templates/backup2.yaml.j2 b/templates/backup2.yaml.j2
index 08e89f4..b8d69d0 100644
--- a/templates/backup2.yaml.j2
+++ b/templates/backup2.yaml.j2
@@ -1,7 +1,8 @@
 version: "2.1"
 services:
     backup_mattermost:
-        image: tecnativa/duplicity:postgres
+        image: remifilament/duplicity:postgres # Until https://github.com/Tecnativa/docker-duplicity/pull/324 is merged
+        # image: ghcr.io/tecnativa/docker-duplicity-postgres:master # Once https://github.com/Tecnativa/docker-duplicity/pull/324 is merged
         hostname: {{ inventory_hostname_short | lower | regex_replace('_','') }}-mattermost
         environment:
             DST: "swift://mattermost_{{ inventory_hostname|lower }}"
@@ -16,7 +17,8 @@ services:
             SWIFT_TENANTNAME: "{{ swift_odoo2_tenantname }}"
             SWIFT_TENANTID: "{{ swift_odoo2_tenantid }}"
             SWIFT_REGIONNAME: "{{ swift_odoo2_regionname }}"
-            JOB_300_WHAT: "backup --full-if-older-than 6D"
+            JOB_200_WHEN: "never"
+            JOB_300_WHAT: "pg_dump --no-owner --no-privileges --file $$SRC/$$PGDATABASE.sql && backup --full-if-older-than 6D"
             JOB_302_WHAT: "dup remove-all-but-n-full 5 --force $$DST $$@"
             JOB_302_WHEN: "daily"
         volumes:
-- 
GitLab