before_everything errors notifications #821

Open
opened 2024-01-27 16:08:40 +00:00 by josephswan · 1 comment

What I'm trying to do and why

Hello, devs.

What is the logic/problem behind not firing the on_error hook or Apprise (or other) fail: notification in case of errors in before_everything hook?

I'd like to make some preparations (like dumping LUKS headers, backing up my local services running in containers, etc.) only once, and then do the actual backup into multiple repositories (local + offsite). Seems like the before_everything (and the cleanup in after_everything) is what I need. What is a proper way to be notified about errors on those steps?

Should I rely on the scheduling app (systemd timer in my case) to get the notifications? Wouldn't it be more convenient to have all notifications settings in one place (in the borgmatic itself)?

### What I'm trying to do and why Hello, devs. What is the logic/problem behind not firing the `on_error` hook or Apprise (or other) `fail:` notification in case of errors in `before_everything` hook? I'd like to make some preparations (like dumping LUKS headers, backing up my local services running in containers, etc.) only once, and then do the actual backup into multiple repositories (local + offsite). Seems like the `before_everything` (and the cleanup in `after_everything`) is what I need. What is a proper way to be notified about errors on those steps? Should I rely on the scheduling app (systemd timer in my case) to get the notifications? Wouldn't it be more convenient to have all notifications settings in one place (in the borgmatic itself)?
Owner

Thanks for filing this!

What is the logic/problem behind not firing the on_error hook or Apprise (or other) fail: notification in case of errors in before_everything hook?

There's no fundamental reason that on_error couldn't trigger whenbefore_everything errors. The main reason it doesn't happen now is incidental: The on_error hook currently triggers on a per-configuration basis, and before_everything happens before the main processing for each configuration file. But it could in theory be altered to trigger on_error.

As for Apprise hook's fail: notification getting triggered, it's the same reason: before_everything happens well before all that Apprise logic kicks in. That could also be changed.

Should I rely on the scheduling app (systemd timer in my case) to get the notifications? Wouldn't it be more convenient to have all notifications settings in one place (in the borgmatic itself)?

As a work-around until this is implemented, yes, you could relying on systemd to notify you of errors.

Thanks for filing this! > What is the logic/problem behind not firing the on_error hook or Apprise (or other) fail: notification in case of errors in before_everything hook? There's no fundamental reason that `on_error` couldn't trigger when`before_everything` errors. The main reason it doesn't happen now is incidental: The `on_error` hook currently triggers on a per-configuration basis, and `before_everything` happens *before* the main processing for each configuration file. But it could in theory be altered to trigger `on_error`. As for Apprise hook's `fail:` notification getting triggered, it's the same reason: `before_everything` happens well before all that Apprise logic kicks in. That could also be changed. > Should I rely on the scheduling app (systemd timer in my case) to get the notifications? Wouldn't it be more convenient to have all notifications settings in one place (in the borgmatic itself)? As a work-around until this is implemented, yes, you could relying on systemd to notify you of errors.
Sign in to join this conversation.
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#821
No description provided.