Remove break-lock, add checking, and fix healthcheck
All checks were successful
ShellCheck / shellcheck (push) Successful in 5s
Docker / build (push) Successful in 15s

This commit is contained in:
Andras Schmelczer 2026-09-27 11:06:27 +01:00
commit be17cc81c3
8 changed files with 209 additions and 73 deletions

View file

@ -1,6 +1,7 @@
#!/bin/bash
SLEEP_TIME=${SLEEP_TIME:-1h}
# Preserve the wrapper's failure through the logging pipeline and stop the loop.
set -eo pipefail
log_message() {
stdbuf -o0 tee -a "$(get_log_file_name)"
@ -17,9 +18,7 @@ date -u '+%Y-%m-%dT%H:%M:%SZ' > /health/container_start_time.log.$$ &&
mv -fT /health/container_start_time.log.$$ /health/container_start_time.log || exit 1
while true; do
# The wrapper checks every repository after backups, using SLEEP_TIME as
# its total check budget. Start the next cycle as soon as checks finish.
/src/backup-wrapper.sh 2>&1 | log_message
echo "Sleeping for $SLEEP_TIME" | log_message
# Using a simple sleep loop to schedule backups instead of cron to avoid concurrency issues
sleep "$SLEEP_TIME"
done