Add context for various hooks. #469

Merged
witten merged 2 commits from cyfdecyf/borgmatic:master into master 2022-03-14 20:13:16 +00:00
Contributor

Variables like repository are not interpolated in hook command which is a little surprise to me, thus made this PR.

Variables like `repository` are not interpolated in hook command which is a little surprise to me, thus made this PR.
cyfdecyf added 1 commit 2021-11-26 03:37:09 +00:00
continuous-integration/drone/pr Build is passing Details
091c07bbe2
Add context for various hooks.
cyfdecyf added 1 commit 2021-11-26 03:39:28 +00:00
continuous-integration/drone/pr Build is passing Details
0014b149f8
remove configuration_filename as it's already set.
Owner

Thanks for taking the time to make this PR! Could you describe your use case for this? This "repository" variable looks like it can sometimes contain multiple repositories, which might be a little unexpected given that the behavior is different from the on_error hook. In general I'm happy to expand the interpolated variables.. I just want to make sure I understand how they might be consumed in downstream scripts. Appreciate it!

Thanks for taking the time to make this PR! Could you describe your use case for this? This "repository" variable looks like it can sometimes contain multiple repositories, which might be a little unexpected given that the behavior is different from the `on_error` hook. In general I'm happy to expand the interpolated variables.. I just want to make sure I understand how they might be consumed in downstream scripts. Appreciate it!
Author
Contributor

My use case is simple. I didn't use any of the monitoring service supported by borgmatic, so I want to send notification for backup start and finish by myself.

My use case is simple. I didn't use any of the monitoring service supported by borgmatic, so I want to send notification for backup start and finish by myself.
Owner

Sorry for the delay here! I'm merging this now, but just a heads up that I'm renaming the context variable to repositories since it can contain more than one! Thanks.

Sorry for the delay here! I'm merging this now, but just a heads up that I'm renaming the context variable to `repositories` since it can contain more than one! Thanks.
witten merged commit 6b500c2a8b into master 2022-03-14 20:13:16 +00:00
Owner

Released in borgmatic 1.5.24.

Released in borgmatic 1.5.24.
Owner

Another heads up: I'm renaming the context variable back to repository in borgmatic 1.6.0 (to be released). This is because #473 changes command hooks to be called on a per-repository basis. The existing repositories context variable should continue to work, however.. It will just be deprecated.

Another heads up: I'm renaming the context variable back to `repository` in borgmatic 1.6.0 (to be released). This is because #473 changes command hooks to be called on a per-repository basis. The existing `repositories` context variable should continue to work, however.. It will just be deprecated.
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#469
No description provided.