Document how to list database dumps in an archive.

This commit is contained in:
Dan Helfman 2023-03-08 16:09:41 -08:00
parent 8d860ea02c
commit d3086788eb
3 changed files with 12 additions and 9 deletions

View file

@ -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

View file

@ -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

View file

@ -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