• LLCDM
  • RSS
Filter untagged links

Healthchecks.io : pour monitorer l'exécution des scripts lancés par cronhttps://healthchecks.io

J'en avais beaucoup entendu parlé, mais jamais testé. C'est fait et adopté !

Avantage : pas besoin de générer une notification d'exécution d'un script pour être certain qu'il se soit exécuté : Healthchecks.io le fait pour toi si le script ne s'exécute pas selon un laps de temps défini, ou qu'il génère une erreur.

Self-hostable bien sûr.

Petit exemple vite fait (et simplifié) avec restic :

RID=$(cat /proc/sys/kernel/random/uuid)

curl -m 10 --retry 5 https://hc-ping.com/[uuid]/start?rid=$RID

DIRS=(
    "/etc"
    "/docker"
    "/root"
    "/var/spool/cron/crontabs"
)

ERROR=0
for DIR in "${DIRS[@]}"; do
    echo "Backuping $DIR..."
    restic backup --no-scan "$DIR" || ERROR=1
done

if [ "$ERROR" -eq 1 ]; then
    curl -m 10 --retry 5 https://hc-ping.com/[uuid]/fail?rid=$RID
    exit 1
fi

curl -m 10 --retry 5 https://hc-ping.com/[uuid]?rid=$RID
Permalink
March 29, 2025 at 1:16:56 PM GMT+1
Shaarli 35 shaares · Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation · Theme : Stack · Font : DINish
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community