From 99dcd17b7aa61f95c4a576c9855cbe3d3919f5f8 Mon Sep 17 00:00:00 2001 From: Einar Stenberg Date: Wed, 21 Aug 2024 09:09:46 +0200 Subject: [PATCH] add healthchecks.io support --- README.md | 1 + reporting.ps1 | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 8914cf5..b4ab350 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ udpate - CLEANBACKUPDIRBEFORE=false #automatically deletes all files from the backup directory before process start - CLEANBACKUPDIRAFTER=false #automatically deletes all files from the backup directory after process run - ARCHIVEPERITEM=false #automatically create 1 archive in the backup per folder in the source directory + - HEALTHCHECKSURL=https://hc-ping.com/xxxxxxxxxxxx #disabled by default, put a healthchecks.io endpoint here or any other similar endpoint you want pinged with a "GET" when the job is successfull #Bitwarden - BW_CLIENTID=87asdhj1 #You API client ID - BW_CLIENTSECRET=secretsecretsecret #Your API secret diff --git a/reporting.ps1 b/reporting.ps1 index 8383bb1..537eab8 100644 --- a/reporting.ps1 +++ b/reporting.ps1 @@ -54,4 +54,6 @@ if(($data | convertfrom-json).status -like "Fail"){ if($retrycount -le $ENV:MAXRETRY){ . /backupscript.ps1 } +}elseif($ENV:HEALTHCHECKSURL){ + invoke-webrequest $ENV:HEALTHCHECKSURL -SkipHttpErrorCheck -SkipCertificateCheck -SkipHeaderValidation -ErrorAction SilentlyContinue }