Skip to content

feat: allow override env RESTIC_HOST with flag to filter all snapshots#5541

Merged
MichaelEischer merged 8 commits into
restic:masterfrom
zmanda:feat-gh-5440-allow-override-env-RESTIC_HOST-with-flag
Oct 5, 2025
Merged

feat: allow override env RESTIC_HOST with flag to filter all snapshots#5541
MichaelEischer merged 8 commits into
restic:masterfrom
zmanda:feat-gh-5440-allow-override-env-RESTIC_HOST-with-flag

Conversation

@konidev20

Copy link
Copy Markdown
Contributor

What does this PR change? What problem does it solve?

When the RESTIC_HOST environment variable was set, there was no way to list or operate on snapshots from all hosts, as the environment variable would always filter to that specific host.

With these changes specifying --host="" will filter snapshots from all hosts.

To maintain consistency I have updated the following commands that support snapshot filtering:
snapshots, forget, find, stats, copy, tag, repair snapshots, rewrite, mount, restore, dump, and ls.

Disclaimer:
I have used the AI IDE Cursor to help me with the repetitive changes across all the commands and the unit tests for these changes.

Was the change previously discussed in an issue or on the forum?

Closes #5440

Checklist

  • I have added tests for all code changes.
  • I have added documentation for relevant changes (in the manual).
  • There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • I'm done! This pull request is ready for review.

@konidev20 konidev20 changed the title Feat gh 5440 allow override env restic host with flag feat: allow override env RESTIC_HOST with flag to filter all snapshots Oct 1, 2025

@MichaelEischer MichaelEischer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in general, except for the nits below:

Comment thread cmd/restic/find.go Outdated
Comment thread cmd/restic/find.go Outdated
Comment thread cmd/restic/cmd_forget_test.go Outdated
Comment thread cmd/restic/find_test.go Outdated

@MichaelEischer MichaelEischer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@MichaelEischer MichaelEischer merged commit 22f254c into restic:master Oct 5, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a way to specify "all hosts" to restic snapshots when $RESTIC_HOST is set

2 participants