healthcheck-code.md hinzugefügt
This commit is contained in:
13
healthcheck-code.md
Normal file
13
healthcheck-code.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
Diesen Code in das Backup-Script einfügen. Vorher einen healthcheck-Eintrag erstellen.
|
||||||
|
|
||||||
|
|
||||||
|
#!/bin/bash
|
||||||
|
HC_URL="http://100.x.y.z:8800/ping/<uuid>"
|
||||||
|
|
||||||
|
# Bei jedem Fehler (egal welcher Befehel schlägt fehl) → fail-Ping + Abbruch
|
||||||
|
trap 'curl -fsS --retry 3 "$HC_URL/fail" >/dev/null' ERR
|
||||||
|
|
||||||
|
# ... dein bisheriges Backup-Script (unverändert) ...
|
||||||
|
|
||||||
|
# Ende erreicht ohne Fehler → Erfolg
|
||||||
|
curl -fsS --retry 3 "$HC_URL" >/dev/null
|
||||||
Reference in New Issue
Block a user