fix(release): stop deployment when off-host backup transfer fails

This commit is contained in:
cesnimda
2026-11-10 13:24:30 +01:00
parent e73681008a
commit cedf33a358
5 changed files with 90 additions and 5 deletions
+9 -3
View File
@@ -574,14 +574,20 @@ upload_current_backup_set() {
remote="${remote%/}"
local current_files=("$BACKUP_DIR"/jobtracker-*"-$BACKUP_STAMP".*) file
for file in "${current_files[@]}"; do
rclone copyto "$file" "$remote/daily/$(basename "$file")" --immutable
if ! rclone copyto "$file" "$remote/daily/$(basename "$file")" --immutable; then
echo "Daily off-host backup upload failed. Aborting deploy."
return 1
fi
done
local month="$(TZ="${BACKUP_TIMEZONE:-Europe/Oslo}" date +%Y-%m)"
if [ -d "$BACKUP_DIR/monthly/$month" ]; then
rclone copy "$BACKUP_DIR/monthly/$month" "$remote/monthly/$month" --immutable
if ! rclone copy "$BACKUP_DIR/monthly/$month" "$remote/monthly/$month" --immutable; then
echo "Monthly off-host backup upload failed. Aborting deploy."
return 1
fi
fi
echo "Current recovery set copied to configured encrypted off-host remote."
echo "Current recovery set copied to configured off-host remote."
}
resolve_existing_web_proxy_subnet