From 2af11b489f072ad67a90683390de494cb50ad520 Mon Sep 17 00:00:00 2001 From: guezoloic Date: Mon, 15 Sep 2025 07:30:07 +0000 Subject: [PATCH] fix(aws-backup.sh): add exit mode if no files/folders written --- scripts/aws-backup.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/aws-backup.sh b/scripts/aws-backup.sh index d537f46..d65e85f 100644 --- a/scripts/aws-backup.sh +++ b/scripts/aws-backup.sh @@ -56,6 +56,10 @@ if [[ "$1" == "clean" ]]; then exit 0 fi +if [[ ! -s "BACKUP" ]]; then + exit 0 +fi + while IFS= read -r SOURCE_PATH || [ -n "$SOURCE_PATH" ]; do if [[ -z "$SOURCE_PATH" || "$SOURCE_PATH" =~ ^[[:space:]]*$ ]]; then continue @@ -102,4 +106,4 @@ if [[ "$BACKUP_SUCCESS" == true ]]; then send_notification "💿 AWS Backup 💿 : All files successfully backed up." else send_notification "💿 AWS Backup 💿 : One or more files failed to back up. Check the log for details." -fi \ No newline at end of file +fi