chore: Update manifests after change

This commit is contained in:
2025-12-20 04:56:25 +00:00
parent ab6749ad7b
commit 68bb4d02b8
4 changed files with 80 additions and 61 deletions

View File

@@ -11,8 +11,35 @@ data:
backup.sh: |
echo " ";
echo ">> Running S3 backup for Vault snapshot";
if s3cmd sync --no-check-certificate -v /opt/backup "${BUCKET}/cl01tl/cl01tl-vault-snapshots/"; then
echo ">> Sync succeeded"
OUTPUT=$(s3cmd sync --no-check-certificate -v /opt/backup "${BUCKET}/cl01tl/cl01tl-vault-snapshots/" 2>&1)
STATUS=$?
echo " ";
if [ $STATUS -ne 0 ]; then
if echo "$OUTPUT" | grep -q "403 Forbidden"; then
MESSAGE="403 Authentication Error: Your keys are wrong or you don't have permission"
elif echo "$OUTPUT" | grep -q "404 Not Found"; then
MESSAGE="404 Error: The bucket or folder does not exist"
elif echo "$OUTPUT" | grep -q "Connection refused"; then
MESSAGE="Network Error: Cannot reach the S3 endpoint"
else
MESSAGE="Unknown Error: $OUTPUT"
echo ">> Unknown Error, output:"
echo " "
echo "$OUTPUT"
echo " "
fi
echo ">> Message: $MESSAGE"
echo ">> Sending to NTFY ..."
curl \
-H "Authorization: Bearer ${NTFY_TOKEN}" \
-H "X-Priority: 5" \
-H "X-Tags: warning" \
-H "X-Title: Vault Backup Failed for ${TARGET}" \
-d "$MESSAGE" \
${NTFY_ENDPOINT}/${NTFY_TOPIC}
else
echo ">> ERROR: Sync failed"
echo ">> S3 Sync succeeded"
fi