mirror of
https://github.com/guezoloic/serverconfig.git
synced 2026-01-25 09:34:23 +00:00
feat: rework aws-backup notification
This commit is contained in:
@@ -74,15 +74,24 @@ while IFS= read -r SOURCE_PATH || [ -n "$SOURCE_PATH" ]; do
|
|||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
info_print "Error while syncing $SOURCE_PATH to the AWS server." 3
|
info_print "Error while syncing $SOURCE_PATH to the AWS server." 3
|
||||||
|
BACKUPSUCCESSED=false
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
else
|
else
|
||||||
info_print "Successfully synced $SOURCE_PATH" 6
|
info_print "Successfully synced $SOURCE_PATH" 6
|
||||||
|
BACKUPSUCCESSED=true
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info_print "$SOURCE_PATH not found or inaccessible." 3
|
info_print "$SOURCE_PATH not found or inaccessible." 3
|
||||||
|
BACKUPSUCCESSED=false
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
done < "$BACKUP"
|
done < "$BACKUP"
|
||||||
|
|
||||||
source /usr/local/bin/libs/notifications.sh
|
source /usr/local/bin/libs/notifications.sh
|
||||||
send_notification "All AWS-backup file have been linked"
|
|
||||||
|
if [[ "$BACKUP_SUCCESS" == true ]]; then
|
||||||
|
send_notification "<b>AWS Backup:</b> All files successfully backed up."
|
||||||
|
else
|
||||||
|
send_notification "<b>AWS Backup:</b> One or more files failed to back up. Check the log for details."
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user