Skip to content

Commit 81c9b50

Browse files
committed
fix: Fixed the critical set-e trap that caused the script to exit after the first container
1 parent 3f4a33b commit 81c9b50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docker-backup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ main() {
537537
for container in "${containers_to_backup[@]}"; do
538538
log_info "正在处理容器 $((success_count + 1))/$total_count: $container"
539539
if backup_container "${container}"; then
540-
((success_count++))
540+
success_count=$((success_count + 1))
541541
log_info "容器 '$container' 备份成功 ($success_count/$total_count)"
542542
else
543543
log_error "备份容器 '${container}' 失败"

0 commit comments

Comments
 (0)