initial commit

This commit is contained in:
BeauTroll
2025-12-16 04:41:26 +01:00
commit 2b048a09e1
16 changed files with 1719 additions and 0 deletions

26
hooks/ntfy-error.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
#
# Hook Borgmatic - Notification d'erreur via ntfy
# Arguments: $1 = error message
#
# Charger les variables d'environnement
if [ -f /etc/borgmatic/.env ]; then
source /etc/borgmatic/.env
fi
ERROR_MSG="${1:-Erreur inconnue}"
# Envoyer notification d'erreur
curl -s -u "$NTFY_USER" \
-H "Title: ❌ Backup échoué" \
-H "Priority: high" \
-H "Tags: x,backup,alert" \
-d "Le backup a échoué !
Erreur: ${ERROR_MSG}
Date: $(date '+%Y-%m-%d %H:%M:%S')
Vérifiez les logs: journalctl -u borgmatic.service -n 50" \
"$NTFY_URL"
echo "Notification d'erreur envoyée à ntfy"
exit 0