From fd1800681cae72d469bdb5f738c9b475491201ba Mon Sep 17 00:00:00 2001 From: Robert McQueen Date: Wed, 22 Dec 2021 18:43:08 +0000 Subject: [PATCH] third_party-borgmatic: Improve volume configuration (#336) Try to more closely match the backup_and_restore.sh script by including postfix, rspamd and redis volumes. Ignore the paths that contain sockets/FIFOs as borgmatic uses these for its mysql backup, which means borg "stuck" trying to read these. Move the generated borg security data and cache to volumes so that they persists without writing in the mailcow/data folder or the overlay. --- docs/third_party-borgmatic.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/third_party-borgmatic.md b/docs/third_party-borgmatic.md index 6c98dcae1..7cec6f34e 100644 --- a/docs/third_party-borgmatic.md +++ b/docs/third_party-borgmatic.md @@ -23,17 +23,23 @@ configuration: ```yaml version: '2.1' + services: borgmatic-mailcow: image: b3vis/borgmatic + hostname: mailcow restart: always dns: ${IPV4_NETWORK:-172.22.1}.254 volumes: - vmail-vol-1:/mnt/source/vmail:ro - crypt-vol-1:/mnt/source/crypt:ro + - redis-vol-1:/mnt/source/redis:ro,z + - rspamd-vol-1:/mnt/source/rspamd:ro,z + - postfix-vol-1:/mnt/source/postfix:ro,z - mysql-socket-vol-1:/var/run/mysqld/:z + - borg-config-vol-1:/root/.config/borg:Z + - borg-cache-vol-1:/root/.cache/borg:Z - ./data/conf/borgmatic/etc:/etc/borgmatic.d:Z - - ./data/conf/borgmatic/state:/root/.config/borg:Z - ./data/conf/borgmatic/ssh:/root/.ssh:Z environment: - TZ=${TZ} @@ -42,6 +48,10 @@ services: mailcow-network: aliases: - borgmatic + +volumes: + borg-cache-vol-1: + borg-config-vol-1: ``` Ensure that you change the `BORG_PASSPHRASE` to a secure passphrase of your choosing. @@ -61,7 +71,10 @@ location: - /mnt/source repositories: - user@rsync.net:mailcow - remote_path: borg1 + exclude_patterns: + - '/mnt/source/postfix/public/' + - '/mnt/source/postfix/private/' + - '/mnt/source/rspamd/rspamd.sock' retention: keep_hourly: 24