mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2026-11-24 14:47:46 +00:00
Report an interrupted update-apps backup as cancelled, not failed (#18867)
This commit is contained in:
1 parent
0cc1b8a1b6
commit
2f79e5b2c3
1 file changed
+7
-1
@@ -275,7 +275,8 @@ function dry_run_container() {
|
||||
function failure_reason() {
|
||||
local reason
|
||||
reason=$(grep -m1 '^ERROR:' <<<"$1" | sed 's/^ERROR: //')
|
||||
[[ -n "$reason" ]] || reason=$(grep -v '^[[:space:]]*$' <<<"$1" | tail -n1)
|
||||
# A rejected option ends in the usage line, the option's error is above it.
|
||||
[[ -n "$reason" ]] || reason=$(grep -v -e '^[[:space:]]*$' -e '\[OPTIONS\]$' <<<"$1" | tail -n1)
|
||||
printf '%s' "$reason"
|
||||
}
|
||||
|
||||
@@ -286,6 +287,11 @@ function backup_container() {
|
||||
msg_ok "Backup created"
|
||||
else
|
||||
log_write "Container $1: vzdump failed:"$'\n'"$output"
|
||||
# Ctrl+C, or the task was stopped: the backup did not fail, it was cancelled.
|
||||
if grep -q "interrupted by signal" <<<"$output"; then
|
||||
msg_error "Backup of container $1 was interrupted (Ctrl+C or the task was stopped)"
|
||||
exit 130
|
||||
fi
|
||||
msg_error "Backup failed for container $1: $(failure_reason "$output")"
|
||||
exit 235
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user