-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Healthchecks integration #179
Comments
Hey there, Have you tried hooks? https://autorestic.vercel.app/location/hooks Adding another option to the config should only be done if it's a generic one. Is there any spec for agnostic healthchecks? But in general I'd say this perfect for hooks, which already solve this functionality |
Hey, i even have a working example which i personally use. This tells healthchecks when you started and when you finished, even with the autorestic location. extras:
default_options: &default_opts
hooks:
before:
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Starting backup for location: ${AUTORESTIC_LOCATION}" https://<healthchecks-url>/ping/<uid>/start'
failure:
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Backup failed for location: ${AUTORESTIC_LOCATION}" https://<healthchecks-url>/ping/<uid>/fail'
success:
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Backup successful for location: ${AUTORESTIC_LOCATION}" https://<healthchecks-url>/ping/<uid>' And if you set it as a yaml anchor you can reuse the snippet for every location. locations:
something:
from: /somewhere
to:
- somewhere-else
<<: *default_opts |
We can include it inthe docs if you wish :) |
Yes, if it helps others. extras:
healthchecks: &healthchecks Or something you find intuitive |
Added. Thanks a lot! |
Hey, thanks for this example! However, I thought it might be nice to have a standard way, so a similar config could be used on Windows and on Linux, without the need to install curl properly on Windows. Currently, curl on Windows is just an alias of Invoke-WebRequest. To make things worse, this a Powerhell-specific alias and does not work anywhere else. |
While there is a PR I have little plans to support windows as it will generate an absurd amount of issues which I can't debug. (Don't use/own windows) |
@Zottelchen: |
Hi,
I have a feature request: An Integration of Healthchecks. There is a hosted version, but it can also be selfhosted. It should do the following things:
Suggested config:
For comparison, here is a shell script I currently use:
The benefit of having that directly integrated here is that it is one thing less to break. Or in a Windows case, one thing less to properly install [curl] as well as not having to fight with shitty Windows batch syntax just to set up a backup for my moms pictures (especially once #68 is merged).
The text was updated successfully, but these errors were encountered: