From b6ccde67570f1599d3fea6d31565eb00e210ea99 Mon Sep 17 00:00:00 2001 From: Jonathan Brockhaus Date: Fri, 16 Aug 2024 14:23:59 +0200 Subject: [PATCH 1/3] fix(docs): Add note about mounting .borgmatic folder inside container db backups --- docs/how-to/backup-your-databases.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/how-to/backup-your-databases.md b/docs/how-to/backup-your-databases.md index 05c48ecb..0278c233 100644 --- a/docs/how-to/backup-your-databases.md +++ b/docs/how-to/backup-your-databases.md @@ -229,7 +229,20 @@ hooks: ... where `my_pg_container` is the name of your database container. In this example, you'd also need to set the `pg_restore_command` and `psql_command` -options. +options. If you choose to use the `pg_dump` within the container though, +note that it tries to output the backup to a file inside the container. +So you'll have to mount the `.borgmatic` folder inside your home folder +with the same directory structure inside the container. + +See the following Docker compose file an as example: + +```yaml +services: + db: + image: postgres + volume: + - /home/USERNAME/.borgmatic:/home/USERNAME/.borgmatic +``` Similar command override options are available for (some of) the other supported database types as well. See the [configuration From 9d83f02e24422279555119fd4ac8b94d895ebe09 Mon Sep 17 00:00:00 2001 From: Jonathan Brockhaus Date: Fri, 16 Aug 2024 14:25:11 +0200 Subject: [PATCH 2/3] fix(config/schema.yaml): Add note about mounting .borgmatic folder inside container db backups --- borgmatic/config/schema.yaml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/borgmatic/config/schema.yaml b/borgmatic/config/schema.yaml index 5b9c51d7..cfbaa732 100644 --- a/borgmatic/config/schema.yaml +++ b/borgmatic/config/schema.yaml @@ -1044,9 +1044,12 @@ properties: description: | Command to use instead of "pg_dump" or "pg_dumpall". This can be used to run a specific pg_dump version - (e.g., one inside a running container). Defaults to - "pg_dump" for single database dump or "pg_dumpall" to - dump all databases. + (e.g., one inside a running container). + If you run it from within a container, make sure to + mount your host ".borgmatic" folder inside + the container with the same directory structure. + Defaults to "pg_dump" for single database dump + or "pg_dumpall" to dump all databases. example: docker exec my_pg_container pg_dump pg_restore_command: type: string @@ -1160,7 +1163,11 @@ properties: description: | Command to use instead of "mariadb-dump". This can be used to run a specific mariadb_dump version (e.g., one - inside a running container). Defaults to "mariadb-dump". + inside a running container). + If you run it from within a container, make sure to + mount your host ".borgmatic" folder inside + the container with the same directory structure. + Defaults to "mariadb-dump". example: docker exec mariadb_container mariadb-dump mariadb_command: type: string @@ -1290,7 +1297,11 @@ properties: description: | Command to use instead of "mysqldump". This can be used to run a specific mysql_dump version (e.g., one inside a - running container). Defaults to "mysqldump". + running container). + If you run it from within a container, make sure to + mount your host ".borgmatic" folder inside + the container with the same directory structure. + Defaults to "mysqldump". example: docker exec mysql_container mysqldump mysql_command: type: string From 6087c12e091e8a3be18783674bfa191fd76e189d Mon Sep 17 00:00:00 2001 From: Jonathan Brockhaus Date: Fri, 16 Aug 2024 14:36:28 +0200 Subject: [PATCH 3/3] docs: typo --- docs/how-to/backup-your-databases.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/how-to/backup-your-databases.md b/docs/how-to/backup-your-databases.md index 0278c233..094bcb94 100644 --- a/docs/how-to/backup-your-databases.md +++ b/docs/how-to/backup-your-databases.md @@ -240,7 +240,7 @@ See the following Docker compose file an as example: services: db: image: postgres - volume: + volumes: - /home/USERNAME/.borgmatic:/home/USERNAME/.borgmatic ```