Add a --list option #61

Closed
opened 2018-05-17 19:55:25 +00:00 by floli · 7 comments
Collaborator

Additionatlly to --check --prune --create add a --list option that does a borg list for all configured repos.

Also add as default action to be run after as the last action.

If you are positive on that idea, but lack the time, I might me able to help you on that.

Additionatlly to `--check --prune --create` add a `--list` option that does a `borg list` for all configured repos. Also add as default action to be run after as the last action. If you are positive on that idea, but lack the time, I might me able to help you on that.
Owner

I could see the utility in this, and in fact manually running borg list is something I find myself doing occasionally. The only reason I've hesitated thus far with adding a --list flag to borgmatic is that there are a ton of other borg sub-commands (info, mount, init, etc). So if we add --list, where do we draw the line?

Note that I'm not at all opposed to adding --list.. It just makes me start thinking about where this will lead.

Thoughts?

I could see the utility in this, and in fact manually running `borg list` is something I find myself doing occasionally. The only reason I've hesitated thus far with adding a `--list` flag to borgmatic is that there are a ton of other borg sub-commands (`info`, `mount`, `init`, etc). So if we add `--list`, where do we draw the line? Note that I'm not at all opposed to adding `--list`.. It just makes me start thinking about where this will lead. Thoughts?
Author
Collaborator

I understand your thoughts about were to draw the line. What should borgmatic as a wrapper do?

The standard use case of borg is certainly to backup and prune, borgmatic covers these.

Main advantages of borgmatic are imho:

  1. YAML based configuration
  2. Easy configuration for multiple repositories
  1. Gives you a sequential batch processing of repos and sets $BORG_REPO accordingly.

For which borg actions is this especially useful?

  • init you just do one and you give very special options.
  • mount hardly makes sense for multiple repos and also requires special option, such as mount point.
  • delete maybe makes sense, but I think its also more non-standard use.
  • info is a clear candidate for inclusion, because its useful for logging unsupervised backup.
  • same goes for list.

The standard use case of borgmatic is unsupervised backup, prune, check. Because of the unsupervised nature, logging is important. For the logging I see a clear benefit of having list and info actions in borgmatic. It gives you a quick overview about the backup state.

My idea of implementation of list is to simply run borg list on all configured repos, maybe with some borgmatic specific configuration added, such as config file and source_directories.

Just my thoughts ;-)

Best Regards!

I understand your thoughts about were to draw the line. What should borgmatic as a wrapper do? The standard use case of borg is certainly to backup and prune, borgmatic covers these. Main advantages of borgmatic are imho: 1. YAML based configuration 2. Easy configuration for multiple repositories 2) Gives you a sequential batch processing of repos and sets $BORG_REPO accordingly. For which borg actions is this especially useful? * `init` you just do one and you give very special options. * `mount` hardly makes sense for multiple repos and also requires special option, such as mount point. * `delete` maybe makes sense, but I think its also more non-standard use. * `info` is a clear candidate for inclusion, because its useful for logging unsupervised backup. * same goes for `list`. The standard use case of borgmatic is *unsupervised* backup, prune, check. Because of the unsupervised nature, logging is important. For the logging I see a clear benefit of having `list` and `info` actions in borgmatic. It gives you a quick overview about the backup state. My idea of implementation of `list` is to simply run `borg list` on all configured repos, maybe with some borgmatic specific configuration added, such as config file and `source_directories`. Just my thoughts ;-) Best Regards!
Owner

Thanks, that's well-reasoned and makes sense to me. I'll start with a --list option.

Thanks, that's well-reasoned and makes sense to me. I'll start with a `--list` option.
Owner

I just implemented --list and --info. Note that I didn't call either of these by default, as I figured that would be unexpected if the verbosity level is low. But you can easily invoke them manually via the borgmatic command-line. This feature will go out in the next release.

I just implemented `--list` and `--info`. Note that I didn't call either of these by default, as I figured that would be unexpected if the verbosity level is low. But you can easily invoke them manually via the borgmatic command-line. This feature will go out in the next release.
Owner

This has just been released as part of borgmatic 1.2.0!

This has just been released as part of borgmatic 1.2.0!
Contributor

That's a very welcome addition. Would it be too much to allow for the --json flavor of it?

Maybe adding the new borgmatic command line options --list-json and --info-json would be easier to implement, rather than detecting the combination of --list and --json.

What's your view on this? I could give it a go an provide a pull request

That's a very welcome addition. Would it be too much to allow for the `--json` flavor of it? Maybe adding the new borgmatic command line options `--list-json` and `--info-json` would be easier to implement, rather than detecting the combination of `--list` and `--json`. What's your view on this? I could give it a go an provide a pull request
Owner

Using the Python argparse library that borgmatic's already using, it would actually be pretty easy to detect the combination of --list and --json. And I think that makes for a little nicer command-line interface.

Feel free to give it a go if you like!

Using the Python `argparse` library that borgmatic's already using, it would actually be pretty easy to detect the combination of `--list` and `--json`. And I think that makes for a little nicer command-line interface. Feel free to give it a go if you like!
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#61
No description provided.