Support notification after backup #39

Closed
opened 2018-01-05 05:34:33 +00:00 by import_bot · 6 comments
Collaborator

It would be very comfortable if borgmatic could notify me after completing a backup, for example via Pushbullet.

My main use case is that I mostly want to run it automatically (via cron), and I don't want to have to check manually if everything worked.


Imported from Taiga issue 38 (done). Created on 2017-08-27T08:25:47+0000 by Fabian Winter.

It would be very comfortable if borgmatic could notify me after completing a backup, for example via Pushbullet. My main use case is that I mostly want to run it automatically (via cron), and I don't want to have to check manually if everything worked. --- Imported from Taiga issue 38 (done). Created on 2017-08-27T08:25:47+0000 by Fabian Winter.
Author
Collaborator

Does Pushbullet have a command-line client? Because if so, you may be able to use the work-around described here to run a follow-on command within the borgmatic cron invocation: https://tree.taiga.io/project/witten-borgmatic/issue/16

Also, what kind of information are you looking for in the notification? This issue may also be relevant: https://tree.taiga.io/project/witten-borgmatic/issue/30


Comment on 2017-08-27T17:30:17+0000 by Dan Helfman.

Does Pushbullet have a command-line client? Because if so, you may be able to use the work-around described here to run a follow-on command within the borgmatic cron invocation: https://tree.taiga.io/project/witten-borgmatic/issue/16 Also, what kind of information are you looking for in the notification? This issue may also be relevant: https://tree.taiga.io/project/witten-borgmatic/issue/30 --- Comment on 2017-08-27T17:30:17+0000 by Dan Helfman.
Author
Collaborator

Hi Dan, thanks for the links!

Issue 16 might be a workaround; pushbullet can be invoked with curl from the command line, but there is also https://github.com/randomchars/pushbullet.py if you want to integrate it.

For now, I'd be happy to see if the backup succeeded or not, but I wouldn't complain if there is more information contained ;)

Do you already have a plan for the notification feature? Maybe I can find time for a pull request, but I'm not familiar with borgmatic's architecture.


Comment on 2017-08-27T17:53:12+0000 by Fabian Winter.

Hi Dan, thanks for the links! Issue 16 might be a workaround; pushbullet can be invoked with curl from the command line, but there is also https://github.com/randomchars/pushbullet.py if you want to integrate it. For now, I'd be happy to see if the backup succeeded or not, but I wouldn't complain if there is more information contained ;) Do you already have a plan for the notification feature? Maybe I can find time for a pull request, but I'm not familiar with borgmatic's architecture. --- Comment on 2017-08-27T17:53:12+0000 by Fabian Winter.
Author
Collaborator

I don't have solid plans for notification, but I think I'll need something. For instance, a pretty essential high-level feature is some way to know whether your backups are succeeding or failing. But that doesn't necessarily mean borgmatic itself needs to send email, integrate with an SMS provider, etc. One way I could see it going is to create a documented way to forward borgmatic results to some other arbitrary command. That way, folks can plug in whatever notification mechanism they like.


Comment on 2017-08-29T04:04:18+0000 by Dan Helfman.

I don't have solid plans for notification, but I think I'll need something. For instance, a pretty essential high-level feature is some way to know whether your backups are succeeding or failing. But that doesn't *necessarily* mean borgmatic itself needs to send email, integrate with an SMS provider, etc. One way I could see it going is to create a documented way to forward borgmatic results to some other arbitrary command. That way, folks can plug in whatever notification mechanism they like. --- Comment on 2017-08-29T04:04:18+0000 by Dan Helfman.
Author
Collaborator

Yeah, that could work. However, I'm a bit skeptic about adding another layer to my borg onion: borgmatic is already a layer around borg to add a nice configuration, and I don't really want to have to use another layer for notifications that calls borgmatic. Maybe borgmatic could execute a user-specified script after it finished successfully?


Comment on 2017-08-30T17:40:32+0000 by Fabian Winter.

Yeah, that could work. However, I'm a bit skeptic about adding another layer to my borg onion: borgmatic is already a layer around borg to add a nice configuration, and I don't really want to have to use another layer for notifications that calls borgmatic. Maybe borgmatic could execute a user-specified script after it finished successfully? --- Comment on 2017-08-30T17:40:32+0000 by Fabian Winter.
Author
Collaborator

Yeah, that's exactly the sort of thing I'm thinking. Either the thing that invokes borgmatic (cron, etc) or borgmatic itself could execute a user-defined script to actually perform the notification. Trying to keep onion layers to a minimum. :)


Comment on 2017-08-31T03:46:32+0000 by Dan Helfman.

Yeah, that's exactly the sort of thing I'm thinking. Either the thing that invokes borgmatic (cron, etc) or borgmatic itself could execute a user-defined script to actually perform the notification. Trying to keep onion layers to a minimum. :) --- Comment on 2017-08-31T03:46:32+0000 by Dan Helfman.
Author
Collaborator

This has been implemented, in the form of a command you can tell borgmatic to run after a backup! Check out borgmatic 1.1.9, just released. There's a new "hooks" section in the configuration file.. Generate a sample file to check it out.


Comment on 2017-10-30T03:36:16+0000 by Dan Helfman.

This has been implemented, in the form of a command you can tell borgmatic to run after a backup! Check out borgmatic 1.1.9, just released. There's a new "hooks" section in the configuration file.. Generate a sample file to check it out. --- Comment on 2017-10-30T03:36:16+0000 by Dan Helfman.
Sign in to join this conversation.
No Milestone
No Assignees
1 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#39
No description provided.