Add Healthchecks service details to architecture and backup documentation, including its role as a Dead man's switch for backups. Update backup scripts to utilize systemd timers instead of cron for improved scheduling. Enhance network topology documentation to reflect Healthchecks integration in the VPS Miran setup. This update clarifies backup processes and enhances overall system reliability.
21 lines
661 B
Bash
Executable File
21 lines
661 B
Bash
Executable File
#!/bin/bash
|
|
# Ping Healthchecks после успешного окна бэкапов (Dead man's switch).
|
|
# Если ping не пришёл — Healthchecks шлёт алерт в Telegram.
|
|
# Конфиг: /root/.healthchecks.env (HEALTHCHECKS_URL, HEALTHCHECKS_HOMELAB_UUID)
|
|
|
|
CONFIG="${HEALTHCHECKS_CONFIG:-/root/.healthchecks.env}"
|
|
if [ -f "$CONFIG" ]; then
|
|
set -a
|
|
# shellcheck source=/dev/null
|
|
source "$CONFIG"
|
|
set +a
|
|
fi
|
|
|
|
HC_URL="${HEALTHCHECKS_URL:-https://healthchecks.katykhin.ru}"
|
|
HC_UUID="${HEALTHCHECKS_HOMELAB_UUID:-}"
|
|
|
|
[ -z "$HC_UUID" ] && exit 0
|
|
|
|
curl -fsS --retry 3 --max-time 10 "${HC_URL}/ping/${HC_UUID}" >/dev/null 2>&1 || true
|
|
exit 0
|