From 84e7dfb2b733896c1b1619f2bac6c9283106ed49 Mon Sep 17 00:00:00 2001 From: Jeremy McClure Date: Fri, 17 Jul 2026 06:18:08 -0400 Subject: [PATCH] docker-stacks-backup: move success msg after restart, add visible status for each step - Show 'Stopping containers...' before docker compose down - Show 'Starting containers...' before docker compose up - Show 'Dumping named volumes...' during volume backup - Move 'Backup complete' message to after stack restart --- docker-stacks-backup/docker-stacks-backup.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docker-stacks-backup/docker-stacks-backup.sh b/docker-stacks-backup/docker-stacks-backup.sh index c51f285..6ff6551 100755 --- a/docker-stacks-backup/docker-stacks-backup.sh +++ b/docker-stacks-backup/docker-stacks-backup.sh @@ -548,7 +548,7 @@ stop_stack() { compose_file="$(resolve_compose_file "$stack_path")" if stack_is_running "$stack_path"; then - log "Stopping stack '$stack_name' ($stack_path)..." + echo " ${CYAN}●${RESET} Stopping containers..." if [ -n "$compose_file" ]; then dry docker compose -f "$compose_file" --project-directory "$stack_path" down 2>/dev/null || \ dry docker compose -p "$stack_name" down 2>/dev/null || \ @@ -571,7 +571,7 @@ start_stack() { compose_file="$(resolve_compose_file "$stack_path")" if [ -n "$compose_file" ]; then - log "Starting stack '$stack_name'..." + echo " ${CYAN}●${RESET} Starting containers..." dry docker compose -f "$compose_file" --project-directory "$stack_path" up -d 2>/dev/null || \ warn "Failed to start stack '$stack_name'" fi @@ -600,6 +600,7 @@ backup_stack() { archive_root="$(_resolve_dir "$archive_root")" local archive_basename archive_basename="$(basename "$stack_path")" + local _backup_size="" header "Backup: ${stack_name}" @@ -622,7 +623,7 @@ backup_stack() { if [ "$XB_BACKUP_VOLUMES" = "false" ]; then warn_named_volumes "$compose_file" "$stack_name" else - log "Dumping named volumes..." + echo " ${CYAN}●${RESET} Dumping named volumes..." backup_named_volumes "$stack_path" "$stack_name" "$compose_file" fi @@ -654,9 +655,7 @@ backup_stack() { tar -czf "$backup_file" --same-permissions --preserve-permissions $XB_EXCLUDE -C "$archive_root" "$archive_basename" fi fix_owner "$backup_file" - local size - size="$(du -h "$backup_file" | cut -f1)" - success "Backup complete: ${BOLD}${size}${RESET}" + _backup_size="$(du -h "$backup_file" | cut -f1)" fi # Capture volume state before cleanup @@ -699,6 +698,10 @@ EOF else start_stack "$stack_path" fi + + if ! $DRY_RUN && [ -n "$_backup_size" ]; then + success "Backup complete: ${BOLD}${_backup_size}${RESET}" + fi } # --- Interactive Restore Menu ------------------------------------------------