fix(books-backup): exit 3 → on_error в if-блоках ES-snapshot (иначе trap ERR молчит, уведомления не шлются) — инцидент 2026-08-29

This commit is contained in:
2026-08-29 13:07:40 +03:00
parent a38a4ba137
commit 4a41be7943

View File

@@ -139,7 +139,7 @@ SNAP_RESULT=$(docker exec elasticsearch curl -sS -X PUT \
echo "ES snapshot result: $SNAP_RESULT"
if ! echo "$SNAP_RESULT" | grep -q '"state":"SUCCESS"'; then
echo "ES snapshot did NOT report SUCCESS state — failing"
exit 3
on_error $LINENO 3
fi
echo "--- prune ES snapshots older than $RETENTION_DAYS ---"
@@ -168,7 +168,7 @@ BSNAP_RESULT=$(docker exec bookva-es curl -sS -X PUT \
echo "bookva-es snapshot result: $BSNAP_RESULT"
if ! echo "$BSNAP_RESULT" | grep -q '"state":"SUCCESS"'; then
echo "bookva-es snapshot did NOT report SUCCESS state — failing"
exit 3
on_error $LINENO 3
fi
echo "--- prune bookva-es snapshots older than $RETENTION_DAYS ---"