From 94ef19ada3eaa5345589c98559a741f5d5c8342f Mon Sep 17 00:00:00 2001 From: cschantz Date: Thu, 6 Nov 2025 20:15:16 -0500 Subject: [PATCH] Simplify backup trigger menu - remove confusing options Simplified flow: 1. Shows available plans from acrocmd 2. Prompts user to enter plan name/ID directly 3. Press Enter to cancel and see web console instructions 4. Then proceeds to backup type and performance selection Removed: - Confusing numbered options (1,2,3) - "Run all plans" option (too dangerous) - Redundant web console option Now more intuitive - users just type the plan name they see. --- modules/backup/acronis-trigger-backup.sh | 117 ++++++----------------- 1 file changed, 30 insertions(+), 87 deletions(-) diff --git a/modules/backup/acronis-trigger-backup.sh b/modules/backup/acronis-trigger-backup.sh index aa7f27e..3ef6bb9 100755 --- a/modules/backup/acronis-trigger-backup.sh +++ b/modules/backup/acronis-trigger-backup.sh @@ -66,31 +66,42 @@ echo "$plan_output" echo "" echo -e "${CYAN}──────────────────────────────────────────────────────────────${NC}" echo "" -echo -e "${BOLD}Trigger Backup Options:${NC}" +echo -e "${BOLD}Select a Plan to Backup:${NC}" echo "" -echo " 1) Run backup for specific plan (by ID)" -echo " 2) Run all protection plans" -echo " 3) Web console method (recommended)" -echo " 0) Cancel" +echo "Enter the plan name or ID from the list above," +echo "or press Enter to cancel and use web console instead." echo "" -echo -n "Select option [3]: " -read -r choice -choice="${choice:-3}" +echo -n "Plan name/ID: " +read -r plan_id -case "$choice" in - 1) - echo "" - echo -n "Enter plan ID (or name) from list above: " - read -r plan_id +if [ -z "$plan_id" ]; then + echo "" + echo -e "${BOLD}Use Web Console Instead${NC}" + echo "" + echo "To trigger backup via web console:" + echo "" + echo "1. Log in to Acronis web console" - if [ -z "$plan_id" ]; then - print_error "Plan ID/name required" - press_enter - exit 1 + # Try to get cloud URL + if [ -f "/etc/Acronis/Global.config" ]; then + cloud_url=$(grep -oP 'CloudUrl[>=\"].*?https://[^\"<]+' /etc/Acronis/Global.config 2>/dev/null | grep -oP 'https://[^\"<]+' | head -1) + if [ -n "$cloud_url" ]; then + echo " ${cloud_url}" fi + fi - echo "" - echo -e "${BOLD}Backup Type Selection${NC}" + echo "" + echo "2. Navigate to: Devices → This server" + echo "3. Click 'Back up now' button" + echo "4. Monitor progress in real-time" + echo "" + press_enter + exit 0 +fi + +# User selected a plan, proceed with backup type selection +echo "" +echo -e "${BOLD}Backup Type Selection${NC}" echo "" echo "Select backup type:" echo " 1) Auto (use plan's configured type)" @@ -176,74 +187,6 @@ case "$choice" in echo " • Agent is online and registered" echo " • No conflicting backups running" fi - ;; - - 2) - echo "" - echo -e "${BOLD}Running All Protection Plans${NC}" - echo "" - echo -e "${YELLOW}Warning:${NC} This will trigger backups for ALL configured plans." - echo "" - echo -n "Continue? (yes/no): " - read -r confirm - - if [[ ! "$confirm" =~ ^[Yy]([Ee][Ss])?$ ]]; then - echo "" - echo "Cancelled" - press_enter - exit 0 - fi - - echo "" - echo "Triggering all protection plans..." - echo "" - - if /usr/sbin/acrocmd backup run --all 2>&1; then - echo "" - print_success "All backups initiated" - echo "" - echo "Monitor progress with 'Check Backup Status'" - else - echo "" - print_error "Failed to start backups" - fi - ;; - - 3) - # Web console method - echo "" - echo -e "${BOLD}Web Console Method${NC}" - echo "" - echo "Steps to trigger backup via web console:" - echo "" - echo "1. Log in to Acronis web console" - - # Try to get cloud URL - if [ -f "/etc/Acronis/Global.config" ]; then - cloud_url=$(grep -oP 'CloudUrl[>=\"].*?https://[^\"<]+' /etc/Acronis/Global.config 2>/dev/null | grep -oP 'https://[^\"<]+' | head -1) - if [ -n "$cloud_url" ]; then - echo " ${cloud_url}" - fi - fi - - echo "" - echo "2. Navigate to: Devices → Select this server" - echo "3. Click 'Back up now' button" - echo "4. Confirm backup settings" - echo "5. Monitor progress in real-time" - echo "" - echo -e "${GREEN}Benefits:${NC}" - echo " ✓ Visual progress monitoring" - echo " ✓ Detailed status updates" - echo " ✓ Easy cancellation if needed" - echo " ✓ Automatic error notifications" - ;; - - 0|*) - echo "" - echo "Cancelled" - ;; -esac echo "" press_enter