fix(release): stop deployment when off-host backup transfer fails
This commit is contained in:
+9
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user