From 0f6c34dc6bae36edaecce71d53288436fab71d50 Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Tue, 12 Apr 2022 23:59:12 +0200 Subject: [PATCH] healthcheck example --- docs/markdown/contrib.md | 1 + docs/markdown/examples.md | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/docs/markdown/contrib.md b/docs/markdown/contrib.md index c478f64..810399f 100644 --- a/docs/markdown/contrib.md +++ b/docs/markdown/contrib.md @@ -9,6 +9,7 @@ This amazing people helped the project! - @david-boles - Docs. - @SebDanielsson - Brew. - @n194 - AUR Package. +- @Zottelchen - Healthchecks example. - @jin-park-dev - Typos. - @sumnerboy12 - Typos. - @FuzzyMistborn - Typos. diff --git a/docs/markdown/examples.md b/docs/markdown/examples.md index 4de828e..2f8ca17 100644 --- a/docs/markdown/examples.md +++ b/docs/markdown/examples.md @@ -14,4 +14,27 @@ This can come in handy if a backup process crashed or if it was accidentally can autorestic exec -b my-backend -- unlock ``` +## Use hooks to integrate with [healthchecks](https://healthchecks.io/) + +> Thanks to @Zottelchen for providing it ❤️ + +```yaml +extras: + healthchecks: &healthchecks + hooks: + before: + - 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Starting backup for location: ${AUTORESTIC_LOCATION}" https:///ping//start' + failure: + - 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Backup failed for location: ${AUTORESTIC_LOCATION}" https:///ping//fail' + success: + - 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Backup successful for location: ${AUTORESTIC_LOCATION}" https:///ping/' + +locations: + something: + <<: *healthchecks + from: /somewhere + to: + - somewhere-else +``` + > :ToCPrevNext