Misleading arg name: borgmatic prune --files
runs borg prune --list
#571
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
borg prune has a
--list
argument that makes borg show the list of pruned/kept archives, see https://borgbackup.readthedocs.io/en/1.1.18/usage/prune.html. This is very helpful together with--dry-run
, after modifying the "keep" rules.Steps to reproduce (if a bug)
borgmatic prune --list
Actual behavior (if a bug)
borgmatic runs action "prune" and "list"
Expected behavior (if a bug)
borgmatic passes
--list
option to borg(Well, let's call it "preferred" behavior instead.)
Other notes / implementation ideas
This is tough. Maybe it's finally time to drop the old
--
actions, maybe for Borg 2.Workaround:
One could probably even use
--override
but yeah, it's not elegant.Just noticed that
borg create
has also--list
but apparently we cover this via verbosity. Related: #195Ah no, so
borgmatic create --files
results inborg --list
.According to the code in https://projects.torsion.org/borgmatic-collective/borgmatic/src/branch/master/borgmatic/borg/prune.py#L64 , the same works for prune but calling it --files` doesn't make a lot of sense here.
It's very confusing.
I tend to believe that this is the cleanest approach.
No way to run `borg prune --list`to Misleading arg name: `borgmatic prune --files` runs `borg prune --list`Okay, so just to make sure I understand, you've identified at least two potential problems with borgmatic's current behavior:
1.
--list
is an alias for theborgmatic list
action rather than actually passing--list
to Borg, which is unexpected.2. You don't want to use
--files
but would rather use--list
.The first point, I totally get. The UX principle of least surprise and everything.
On point 2, the intent with
--files
is that (forcreate
), it does more than just--list
, it also passes a--filter
argument to Borg so that it doesn't show all file types by default.So is that behavior you don't want/expect? Or is it more that you expect borgmatic to support all/most Borg parameters? It certainly doesn't in all cases, although I guess you could make an argument this is one that should be supported.
I'd be open to that, although borgmatic won't necessarily need to make breaking changes to support Borg 2. Related: #557.
Ah no, I think you're misunderstanding my point 2.
--files
totally makes sense forcreate
.However, not only
create
accepts--files
but alsoprune
. And this is a way to invokeborg prune --list
(at least from looking at the code, I haven't tried it). But this is nonsense.borg prune --list
lists archives, not files.Yes, I think this would be nice to have yes, it's indepedent of the two points I raise here.
Done in master and will be part of the next release. Here are the changes:
Thanks for suggesting this!
Just released in borgmatic 1.7.0!
Awesome, thanks! Let's hope it won't break too many old configs. ;)