Output of restic version
restic 0.18.0 compiled with go1.24.3 on linux/amd64
What should restic do differently? Which functionality do you think we should add?
When I run restic snapshots with $RESTIC_HOST set, I can't get it to show the list of all snapshots across all hosts.
Basically I think this issue comes about cause restic is using the same parameter name for 2 different purposes. For some commands host is metadata to be stored. For others it's a filter. Conceptually the same issue exists with tags, however there is no environment variable for that so it's only theoretical there.
Initial thoughts are that if a command accepts multiple --host args (because host acts as a filter), then it should not default to $RESTIC_HOST, but instead default to all hosts. Only commands that accept a single instance of the host parameter (because it is treated as metadata to be written) should default to $RESTIC_HOST. Potentially there should be a $RESTIC_HOST_FILTER env variable that is used when host is a filter rather than metadata.
However this is probably a breaking change for some users. So a more palatable solution may be a flag (maybe --all-hosts) or special hostname (maybe '*') that ignores previously set host filters.
There are workarounds, but they are clunky:
env -u RESTIC_HOST restic snapshots
or
(unset RESTIC_HOST; restic snapshots)
These are obviously for "bourne"ish shells. I can see this being more awkward for python scripts, not sure how it would be done for powershell, etc.
What are you trying to do? What problem would this solve?
In general when I run restic, I source a file which sets many restic related env variables, including $RESTIC_HOST. This makes running commands cleaner and avoids errors where I forget to specify host (or pack size, or compression, etc.).
What I'm then trying to do is list all snapshots in a repo across all hosts. I will also have the same issue for restic forget and possibly others I haven't found.
The generalised version of the problem is that everything set by env variables should be overridable by command line args (a common convention across command line tools), and that's not true for $RESTIC_HOST.
Did restic help you today? Did it make you happy in any way?
Usually restic makes backups simple. Overall I'm very grateful restic exists, though today it surprised me in a way that was frustrating to debug and workaround.
Output of
restic versionrestic 0.18.0 compiled with go1.24.3 on linux/amd64What should restic do differently? Which functionality do you think we should add?
When I run
restic snapshotswith $RESTIC_HOST set, I can't get it to show the list of all snapshots across all hosts.Basically I think this issue comes about cause restic is using the same parameter name for 2 different purposes. For some commands host is metadata to be stored. For others it's a filter. Conceptually the same issue exists with tags, however there is no environment variable for that so it's only theoretical there.
Initial thoughts are that if a command accepts multiple --host args (because host acts as a filter), then it should not default to $RESTIC_HOST, but instead default to all hosts. Only commands that accept a single instance of the host parameter (because it is treated as metadata to be written) should default to $RESTIC_HOST. Potentially there should be a $RESTIC_HOST_FILTER env variable that is used when host is a filter rather than metadata.
However this is probably a breaking change for some users. So a more palatable solution may be a flag (maybe --all-hosts) or special hostname (maybe '*') that ignores previously set host filters.
There are workarounds, but they are clunky:
env -u RESTIC_HOST restic snapshotsor
(unset RESTIC_HOST; restic snapshots)These are obviously for "bourne"ish shells. I can see this being more awkward for python scripts, not sure how it would be done for powershell, etc.
What are you trying to do? What problem would this solve?
In general when I run restic, I source a file which sets many restic related env variables, including $RESTIC_HOST. This makes running commands cleaner and avoids errors where I forget to specify host (or pack size, or compression, etc.).
What I'm then trying to do is list all snapshots in a repo across all hosts. I will also have the same issue for
restic forgetand possibly others I haven't found.The generalised version of the problem is that everything set by env variables should be overridable by command line args (a common convention across command line tools), and that's not true for $RESTIC_HOST.
Did restic help you today? Did it make you happy in any way?
Usually restic makes backups simple. Overall I'm very grateful restic exists, though today it surprised me in a way that was frustrating to debug and workaround.