From 5c7f9a05f3f96aa0786c9dcd95d1856b79215e3a Mon Sep 17 00:00:00 2001 From: Sheppy Date: Sat, 20 Jul 2024 08:29:17 +0000 Subject: [PATCH] feat: empty file check to slapd backup --- roles/backup-vm/templates/slapd_backup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/backup-vm/templates/slapd_backup.sh b/roles/backup-vm/templates/slapd_backup.sh index 577d98b..e771cd8 100644 --- a/roles/backup-vm/templates/slapd_backup.sh +++ b/roles/backup-vm/templates/slapd_backup.sh @@ -9,6 +9,14 @@ rsync -r --remove-source-files sheppy@192.168.122.112:$DIR /home/sheppy rsync --delete --rsh="/usr/bin/sshpass -p HISTORY_PURGED_SECRET ssh -p23" -r slapd_backup/* u244665-sub2@u244665.your-storagebox.de:./slapd_backup/ +for file in "$DIR"/*; do + # Check if the file is empty + if [ ! -s "$file" ]; then + echo "Empty file found: $file" + exit 1 + fi +done + curl -H "Content-Type: application/json" \ -X POST https://async-icinga.atlantishq.de/report \ -d '{ "service" : "slapd_backup", "token" : "HISTORY_PURGED_SECRET", "status" : "OK", "info" : "" }'