瀏覽代碼

Documentation and config schema update about ~/.borgmatic volume mount (#906).

Reviewed-on: https://projects.torsion.org/borgmatic-collective/borgmatic/pulls/907
Dan Helfman 10 月之前
父節點
當前提交
1fb943e5f1
共有 2 個文件被更改,包括 30 次插入6 次删除
  1. 16 5
      borgmatic/config/schema.yaml
  2. 14 1
      docs/how-to/backup-your-databases.md

+ 16 - 5
borgmatic/config/schema.yaml

@@ -1044,9 +1044,12 @@ properties:
                     description: |
                     description: |
                         Command to use instead of "pg_dump" or "pg_dumpall".
                         Command to use instead of "pg_dump" or "pg_dumpall".
                         This can be used to run a specific pg_dump version
                         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
                     example: docker exec my_pg_container pg_dump
                 pg_restore_command:
                 pg_restore_command:
                     type: string
                     type: string
@@ -1160,7 +1163,11 @@ properties:
                     description: |
                     description: |
                         Command to use instead of "mariadb-dump". This can be
                         Command to use instead of "mariadb-dump". This can be
                         used to run a specific mariadb_dump version (e.g., one
                         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
                     example: docker exec mariadb_container mariadb-dump
                 mariadb_command:
                 mariadb_command:
                     type: string
                     type: string
@@ -1290,7 +1297,11 @@ properties:
                     description: |
                     description: |
                         Command to use instead of "mysqldump". This can be used
                         Command to use instead of "mysqldump". This can be used
                         to run a specific mysql_dump version (e.g., one inside a
                         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
                     example: docker exec mysql_container mysqldump
                 mysql_command:
                 mysql_command:
                     type: string
                     type: string

+ 14 - 1
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
 ... 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`
 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
+    volumes:
+      - /home/USERNAME/.borgmatic:/home/USERNAME/.borgmatic
+```
 
 
 Similar command override options are available for (some of) the other
 Similar command override options are available for (some of) the other
 supported database types as well. See the [configuration
 supported database types as well. See the [configuration