diff --git a/modules/backup/mysql-restore-to-sql.sh b/modules/backup/mysql-restore-to-sql.sh index c35c905..417c212 100755 --- a/modules/backup/mysql-restore-to-sql.sh +++ b/modules/backup/mysql-restore-to-sql.sh @@ -736,6 +736,11 @@ show_recovery_options() { echo "════════════════════════════════════════════════════════════════" echo "" fi + + # NOTE: After showing recovery options, the script will exit and user must + # re-run it with the selected recovery level in Step 4. + # This is intentional to avoid automatic retries with different recovery levels + # which could cause data corruption if blindly escalating through levels. } # Check available disk space (CRITICAL SAFETY CHECK #3) @@ -878,12 +883,6 @@ start_second_instance() { return 1 fi - # Verify using custom socket (not live MySQL socket) - if [ -S "/var/lib/mysql/mysql.sock" ] && [ "$datadir/socket.mysql" = "/var/lib/mysql/mysql.sock" ]; then - print_error "CRITICAL: Attempting to use live MySQL socket!" - return 1 - fi - # Display isolation confirmation echo "" print_success "Safety checks passed:" @@ -998,7 +997,7 @@ start_second_instance() { done # Check if process is still running - if ! kill -0 $pid 2>/dev/null; then + if ! kill -0 "$pid" 2>/dev/null; then print_error "Second MySQL instance failed to start" echo "" @@ -1660,10 +1659,10 @@ step5_create_dump() { print_warning "Your live MySQL instance will NOT be affected." echo "" - echo -n "Proceed with dump creation? (y/n, or 0 to cancel): " + echo -n "Proceed with dump creation? (y/n): " read -r confirm - if [ "$confirm" = "0" ] || [ "$confirm" != "y" ]; then + if [ "$confirm" != "y" ]; then echo "Operation cancelled." press_enter exit 0