Borg 2 changes: Default the "archive_name_format" option to just "{hostname}". Update the "--match-archives"/"--archive" flags to support series names / archive hashes. Add a "--match-archives" flag to the "prune" action.
All checks were successful
build / test (push) Successful in 5m38s
build / docs (push) Successful in 2m1s

This commit is contained in:
2024-10-25 14:26:31 -07:00
parent ad21eb41ae
commit 83bc737185
14 changed files with 332 additions and 52 deletions

View File

@@ -11,7 +11,7 @@ services:
ENVIRONMENT: development
message:
image: alpine
container_name: message
container_name: borgmatic-docs-message
command:
- sh
- -c

View File

@@ -336,15 +336,15 @@ borgmatic restore --archive host-2023-01-02T04:06:07.080910
(No borgmatic `restore` action? Upgrade borgmatic!)
With newer versions of borgmatic, you can simplify this to:
Or you can simplify this to:
```bash
borgmatic restore --archive latest
```
The `--archive` value is the name of the archive to restore from. This
restores all databases dumps that borgmatic originally backed up to that
archive.
The `--archive` value is the name of the archive or archive hash to restore
from. This restores all databases dumps that borgmatic originally backed up to
that archive.
This is a destructive action! `borgmatic restore` replaces live databases by
restoring dumps from the selected archive. So be very careful when and where

View File

@@ -40,10 +40,10 @@ Or simplify this to:
borgmatic extract --archive latest
```
The `--archive` value is the name of the archive to extract. This extracts the
entire contents of the archive to the current directory, so make sure you're
in the right place before running the command—or see below about the
`--destination` flag.
The `--archive` value is the name of the archive or archive hash to extract.
This extracts the entire contents of the archive to the current directory, so
make sure you're in the right place before running the command—or see below
about the `--destination` flag.
## Repository selection
@@ -131,6 +131,14 @@ Or use the "latest" value for the archive to mount the latest archive:
borgmatic mount --archive latest --mount-point /mnt
```
<span class="minilink minilink-addedin">With Borg version 2.x</span>You can
provide a series name for the `--archive` value to mount multiple archives in
that series:
```bash
borgmatic mount --archive seriesname --mount-point /mnt
```
If you'd like to restrict the mounted filesystem to only particular paths from
your archive, use the `--path` flag, similar to the `extract` action above.
For instance:

View File

@@ -82,10 +82,14 @@ this option in the `storage:` section of your configuration.
This example means that when borgmatic creates an archive, its name will start
with the string `home-directories-` and end with a timestamp for its creation
time. If `archive_name_format` is unspecified, the default is
time. If `archive_name_format` is unspecified, the default with Borg 1 is
`{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}`, meaning your system hostname plus a
timestamp in a particular format.
<span class="minilink minilink-addedin">With Borg version 2.x</span>The default
is just `{hostname}`, as Borg 2 does not require unique archive names; identical
archive names form a common "series" that can be targeted together.
### Archive filtering
@@ -129,10 +133,13 @@ archive_name_format: {hostname}-user-data-{now}
match_archives: sh:myhost-user-data-*
```
For Borg 1.x, use a shell pattern for the `match_archives` value and see the
[Borg patterns
<span class="minilink minilink-addedin">With Borg version 1.x</span>Use a shell
pattern for the `match_archives` value and see the [Borg patterns
documentation](https://borgbackup.readthedocs.io/en/stable/usage/help.html#borg-help-patterns)
for more information. For Borg 2.x, see the [match archives
for more information.
<span class="minilink minilink-addedin">With Borg version 2.x</span>See the
[match archives
documentation](https://borgbackup.readthedocs.io/en/2.0.0b12/usage/help.html#borg-help-match-archives).
Some borgmatic command-line actions also have a `--match-archives` flag that