Closed ekool closed 3 years ago
Have you tried using the run_after_backup setting. You can run a curl command to ping healthchecks.io to indicate success. Instructions on how to construct the curl command can be found here:
https://healthchecks.io/docs/bash/
So, adding something like the following to your Emborg config file should work:
run_after_backup = [
'curl -fsS -m 10 --retry 5 -o /dev/null https://hc-ping.com/your-uuid-here',
# notify healthchecks.io that backsups were successful
]
Yes, I'm using exactly this... essentially emborg and borgmatic have that same function. But this is what the healthchecks.io looks like with borgmatic vs emborg. The details in the borgmatic version are most helpful as a quick way to look at historical data on previous runs.
vs emborg
As you can see, the emborg is setup to only send the exit status easily with the URL/$?
Ah, I see. Yeah, that should not be too difficult. Let me see what I can do.
I have upgraded Emborg on github. Can you try it out and see if it meets your needs. Once you have downloaded and installed the latest version from github, you can configure it to use healthchecks.io by adding your UUID into your configuration file as follows:
healthchecks_uuid = '51cb35d8-2975-110b-67a7-11b65d432027'
Then it should let healthchecks.io know when your backup is starting and when it finished and whether it succeeded or failed.
I tried and got the following
` emborg create --progress
Running Borg create command ...
Traceback (most recent call last):
File "/usr/local/bin/emborg", line 33, in
It ran for a while and then popped out with this error.
Whoops. Sorry about that. I have fixed the code and updated the git repository. Please try again. Be aware that uploading the logfile to healthchecks.io will not work if you use the --progress option. With --progress the output of Borg goes to stdout and is not captured by Emborg, so it is not available to upload to healthchecks.io.
Worked like a charm!
Archive name: centmin2-root-backups-2021-06-18T11:13:02
Archive fingerprint: 62e64a5f71740cd1ff05ffd1888e5a6ec161955fe8c8607ee3f2381a0bbe6c88
Time (start): Fri, 2021-06-18 11:13:13
Time (end): Fri, 2021-06-18 11:15:51
Duration: 2 minutes 38.69 seconds
Number of files: 838611
Utilization of max. archive size: 0%
------------------------------------------------------------------------------
Original size Compressed size Deduplicated size
This archive: 120.28 GB 107.27 GB 150.61 MB
All archives: 1.60 TB 1.45 TB 109.94 GB
Unique chunks Total chunks
Chunk index: 639866 12033588
Okay, do you need it in pypi right away? I am tempted to hold off for a while and add other monitoring services.
Okay, do you need it in pypi right away? I am tempted to hold off for a while and add other monitoring services.
Not in any hurry at all! Love the software. Please take your time.
Thanks!
I have updated pypi with the latest version.
Borgmatic has a really nice feature where it will do a POST to healthchecks.io upon job completion. The POST body contains the stats of the job, not just the exit value. It would be nice if Emborg had this ability as well.