Added backup playbook

This commit is contained in:
epickiwi committed 2026-11-07 14:53:28 +01:00
1 parent 82f5efd2ec
commit 25ec8bb21d
7 files changed
+173

No files matched your search

@@ -0,0 +1,13 @@
#!/bin/bash
BACKUP_DIR="/opt/backup/pending"
UNIFIEDPUSH_TOPIC="https://push.epickiwi.fr/hP4ByeeTDeLmCCPN-sauvegardes-mel"
PENDING_BACKUP_COUNT=$( find "$BACKUP_DIR" -type f | grep -e '\.tar\(.gz\)*$' | wc -l )
if [[ "$PENDING_BACKUP_COUNT" -gt 0 ]]; then
curl -d "$(hostname --long): $PENDING_BACKUP_COUNT pending backups" "$UNIFIEDPUSH_TOPIC"
echo "Advertized $PENDING_BACKUP_COUNT panding backup"
else
echo "There is no pending backup"
fi