Add support for specifying --host via environment variable

This commit adds support for specifying the `--host` option via the `RESTIC_HOST` environment variable. This is done by extending option processing in `cmd_backup.go` and for `restic.SnapshotFilter` in `find.go`.
This commit is contained in:
Altan Orhon
2024-03-18 13:20:45 -07:00
committed by Michael Eischer
parent a7b5e09902
commit 871ea1eaf3
3 changed files with 32 additions and 3 deletions

View File

@@ -0,0 +1,9 @@
Enhancement: Allow specifying `--host` via environment variable
Restic commands that operate on snapshots, such as `restic backup` and
`restic snapshots`, support the `--host` flag to specify the hostname for
grouoping snapshots. They now permit selecting the hostname via the
environment variable `RESTIC_HOST`. `--host` still takes precedence over the
environment variable.
https://github.com/restic/restic/issues/4733