unable to use runtime variables for notification #384
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#384
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
hello,
after reading https://torsion.org/borgmatic/docs/how-to/monitor-your-backups/#error-hooks i setup this configuration option:
but the mail text i actually receive is:
am i doing something wrong? i even tried with
/bin/echo -e "Error:\n{error}\n\nOutput:\n{output}"
(with the variables within double quotes with the rest of the text) but same resultthanks!
Can someone provide any input here? thanks!
Sorry for the delay here. The interpolated variables you're trying to use (
{error}
and{output}
) are actually only available within theon_error
hook, because that's the hook that's called with the error when one occurs! So you could try switching your configuration to this:Let me know whether that works for you.
thanks @witten now it's a bit more clear! What i was trying to achive was to get either a
{error}
if there was one, and the backup{output}
at the end of the cronjob, so that i would be aware of both a positive or a negative outcome.i'm wondering if there's a way to get a brief summary of the result of a backup via email, just so that i can know thta the backup completed and if there's been any error
thanks!
How are you running borgmatic? If you run it with a job runner like cron or systemd, that should collect any output and email you in the case of output or error (depending on configuration).
An alternative would be to use borgmatic's integration with monitoring services like Healthchecks.io. With Healthchecks in particular, all borgmatic logs are sent over to that service, and it can alert you on various conditions.
i have a daily cron that run
borgmatic
(that's the whole command-line), but it doesnt produce any output; should i run it with--stats
or some other flags?Yeah, you'll need to decide which output you're interested in. Some options are:
--verbosity 1
,--verbosity 2
,--stats
, and/or--files
.If you use one/some of those, I believe cron should send you the output!
i played around with the options you mentioned, and for now i'm gonna stick with
--stats
.please note neither
--stats
nor--files
are present in the--help
message, are they other switches that are missing?Those are options for
create
(an implicit action when you just runborgmatic
), so their help shows up in the output ofborgmatic create --help
.gotcha, thanks for your help!
Sure thing!