only run hooks when creating an archive #75
No reviewers
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#75
Loading…
Reference in New Issue
No description provided.
Delete Branch ":fix-72-hooks-are-executed-when-list-or-info"
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?
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.
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. Maybebefore_create
andafter_create
.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!