From d3086788ebe58744515d2515a90ba7a049aefe04 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Wed, 8 Mar 2023 16:09:41 -0800 Subject: [PATCH] Document how to list database dumps in an archive. --- docs/Dockerfile | 2 +- docs/how-to/backup-your-databases.md | 5 ++++- docs/how-to/inspect-your-backups.md | 14 +++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/docs/Dockerfile b/docs/Dockerfile index ef29da82..8800cc1f 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -4,7 +4,7 @@ COPY . /app RUN apk add --no-cache py3-pip py3-ruamel.yaml py3-ruamel.yaml.clib RUN pip install --no-cache /app && generate-borgmatic-config && chmod +r /etc/borgmatic/config.yaml RUN borgmatic --help > /command-line.txt \ - && for action in rcreate transfer prune compact create check extract export-tar mount umount restore rlist list rinfo info break-lock borg; do \ + && for action in rcreate transfer create prune compact check extract export-tar mount umount restore rlist list rinfo info break-lock borg; do \ echo -e "\n--------------------------------------------------------------------------------\n" >> /command-line.txt \ && borgmatic "$action" --help >> /command-line.txt; done diff --git a/docs/how-to/backup-your-databases.md b/docs/how-to/backup-your-databases.md index 602f6488..bc21b659 100644 --- a/docs/how-to/backup-your-databases.md +++ b/docs/how-to/backup-your-databases.md @@ -316,7 +316,10 @@ user and you're extracting to `/tmp`, then the dump will be in `/tmp/root/.borgmatic`. After extraction, you can manually restore the dump file using native database -commands like `pg_restore`, `mysql`, `mongorestore` or similar. +commands like `pg_restore`, `mysql`, `mongorestore`, `sqlite`, or similar. + +Also see the documentation on [listing database +dumps](https://torsion.org/borgmatic/docs/how-to/inspect-your-backups/#listing-database-dumps). ## Preparation and cleanup hooks diff --git a/docs/how-to/inspect-your-backups.md b/docs/how-to/inspect-your-backups.md index 77e9bea2..57a2381c 100644 --- a/docs/how-to/inspect-your-backups.md +++ b/docs/how-to/inspect-your-backups.md @@ -91,19 +91,19 @@ example, to search only the last five archives: borgmatic list --find foo.txt --last 5 ``` -## Monitoring mysql backup size +## Listing database dumps -If you have enabled borgmatic's native mysql hook you can query the size of your sql backups from the host you're backing up itself. This works even when using an append-only access key like you can use on borgbase.com. +If you have enabled borgmatic's [database +hooks](https://torsion.org/borgmatic/docs/how-to/backup-your-databases/), you +can list backed up database dumps via borgmatic. For example: -For example: ```bash -borgmatic list --archive latest --no-color | grep root/.borgmatic/mysql_databases/localhost/ +borgmatic list --archive latest --find .borgmatic/*_databases ``` -Note that the `localhost` part of the path in the regex is dependent on how your config looks. If you connect to an external database your config, change to the regexp accordingly because the path will be different. +This gives you a listing of all database dump files contained in the latest +archive, complete with file sizes. -An additional caveat is that when you specify "all" for your database config, there will be one file named "all.sql" in the localhost folder. -Specify your database names in config individually to have one file per database. ## Logging