fix(books-backup): exit 3 → on_error в if-блоках ES-snapshot (иначе trap ERR молчит, уведомления не шлются) — инцидент 2026-08-29
This commit is contained in:
@@ -139,7 +139,7 @@ SNAP_RESULT=$(docker exec elasticsearch curl -sS -X PUT \
|
|||||||
echo "ES snapshot result: $SNAP_RESULT"
|
echo "ES snapshot result: $SNAP_RESULT"
|
||||||
if ! echo "$SNAP_RESULT" | grep -q '"state":"SUCCESS"'; then
|
if ! echo "$SNAP_RESULT" | grep -q '"state":"SUCCESS"'; then
|
||||||
echo "ES snapshot did NOT report SUCCESS state — failing"
|
echo "ES snapshot did NOT report SUCCESS state — failing"
|
||||||
exit 3
|
on_error $LINENO 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "--- prune ES snapshots older than $RETENTION_DAYS ---"
|
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"
|
echo "bookva-es snapshot result: $BSNAP_RESULT"
|
||||||
if ! echo "$BSNAP_RESULT" | grep -q '"state":"SUCCESS"'; then
|
if ! echo "$BSNAP_RESULT" | grep -q '"state":"SUCCESS"'; then
|
||||||
echo "bookva-es snapshot did NOT report SUCCESS state — failing"
|
echo "bookva-es snapshot did NOT report SUCCESS state — failing"
|
||||||
exit 3
|
on_error $LINENO 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "--- prune bookva-es snapshots older than $RETENTION_DAYS ---"
|
echo "--- prune bookva-es snapshots older than $RETENTION_DAYS ---"
|
||||||
|
|||||||
Reference in New Issue
Block a user