only run hooks when creating an archive #75

Merged
witten merged 1 commits from :fix-72-hooks-are-executed-when-list-or-info into master 2018-07-01 21:47:39 +00:00
Contributor

As reported on #72, hooks are run when calling borgmatic with the --list or --info options.

As figured out from the code, hooks are actually always run, even when using the --check and --prune options without the --create option.

This PR change the behavior so that borgmatic only run hooks when an archive is actually to be created.

As reported on #72, hooks are run when calling borgmatic with the `--list` or `--info` options. As figured out from the code, hooks are actually always run, even when using the `--check` and `--prune` options without the `--create` option. This PR change the behavior so that borgmatic only run hooks when an archive is actually to be created.
Author
Contributor

One might argue that running hooks before --check or --prune might still be useful (let say, mounting a filesystem to access the borg repository). If this usecase is to be supported, then it might be better to create specific hooks for the creation of archives. Maybe before_create and after_create.

One might argue that running hooks before `--check` or `--prune` might still be useful (let say, mounting a filesystem to access the borg repository). If this usecase is to be supported, then it might be better to create specific hooks for the creation of archives. Maybe `before_create` and `after_create`.
witten closed this pull request 2018-07-01 21:47:39 +00:00
Owner

Thanks for doing this!

I agree about the more specific hooks. We can add those if/when those additional use cases arise.

And a reminder: Feel free to add to AUTHORS for any work on borgmatic you do!

Thanks for doing this! I agree about the more specific hooks. We can add those if/when those additional use cases arise. And a reminder: Feel free to add to AUTHORS for any work on borgmatic you do!
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 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#75
No description provided.