Commit Graph

10 Commits

Author SHA1 Message Date
cschantz b03179cc95 Add comprehensive Acronis backup management interface
Implemented complete backup management section with acrocmd integration:

New Features:
- Backup Manager: Centralized interface with organized sections
  • Agent Management (status, logs)
  • Backup Operations (list, trigger, status)
  • Plan Management (view, manage protection plans)
  • Restore Operations (placeholder for future)

Scripts Created:
- acronis-backup-manager.sh: Main backup management menu
- acronis-list-backups.sh: Lists archives and backup details
- acronis-trigger-backup.sh: Triggers manual backups with plan selection
- acronis-backup-status.sh: Shows active tasks and recent activities
- acronis-schedule-viewer.sh: Displays protection plans and schedules
- acronis-plan-manager.sh: Manages protection plans (view/enable/disable/delete)

Integration:
- All scripts use acrocmd CLI for programmatic backup operations
- Updated Acronis menu with streamlined "Manage Backups" option
- Reorganized menu structure for better usability
- Added proper error handling and status checks
2025-11-06 16:25:10 -05:00
cschantz f291a1f0c5 Implement functional Acronis agent upgrade
Completely rewrote acronis-update.sh to actually perform upgrades:

Features:
- Checks current version before upgrade
- Shows service status
- Two upgrade methods:
  1. Automatic (web console instructions)
  2. Manual (downloads and runs upgrade)

Manual Upgrade Process:
- Detects existing installation automatically
- Extracts cloud URL from /etc/Acronis/Global.config
- Downloads latest installer from correct region
- Runs installer in unattended mode (-a flag)
- Installer automatically upgrades over existing installation
- Preserves configuration and registration
- Shows version before/after upgrade
- Verifies services running after upgrade
- Offers to restart services if needed
- Cleans up download files

What Gets Preserved During Upgrade:
✓ Agent registration (stays connected to account)
✓ Backup plan configurations
✓ Connection settings
✓ Service configurations

Based on Acronis documentation research:
- Running installer over existing installation = automatic upgrade
- No uninstall needed
- No re-registration needed
2025-11-06 16:12:24 -05:00
cschantz 9cc1d70c83 Use toolkit downloads folder instead of /tmp or /root
Better approach per user suggestion:
- Downloads to: /root/server-toolkit/downloads/acronis-install-YYYYMMDD-HHMMSS/
- Keeps toolkit directory organized
- Avoids polluting /root
- Avoids /tmp noexec issues
- Added downloads/ to .gitignore
- Cleanup removes timestamped installation directory after completion

Benefits:
- All downloads in one place
- Easy to find if debugging needed
- Cleaner than scattered in /root
- Still allows execution (not in /tmp)
2025-11-06 16:06:35 -05:00
cschantz 0d82eefb1a Fix installer execution by using /root instead of /tmp
Root cause: /tmp is mounted with noexec flag preventing execution.

Changed TEMP_DIR from /tmp/acronis-install to /root/acronis-install
This allows the installer binary to execute properly.

Verified: mount shows /tmp with noexec option
Solution: Use /root which allows execution
2025-11-06 16:03:06 -05:00
cschantz 29c260e85c Simplify installer execution - remove overly strict checks
Removed the -x check that was failing despite file being executable.
Changed to simple file existence and size validation instead.
Back to direct execution (./ ) instead of bash wrapper.

The file shows -rwxr-xr-x so it has execute permissions.
The issue was the test itself, not the permissions.
2025-11-06 16:00:50 -05:00
cschantz 03aea73fca Fix Acronis installer execution permissions issue
Changes:
- Added verification after chmod +x to ensure permissions were set
- Changed execution from './file' to 'bash ./file' for better compatibility
- Added detailed error handling if chmod fails
- Shows file permissions on error for debugging

This fixes 'Permission denied' error (exit code 126) when running installer.
2025-11-06 15:58:24 -05:00
cschantz d4878c2d27 Fix installer confirmation to accept 'y' in addition to 'yes'
Changed confirmation check from exact 'yes' match to regex pattern that accepts:
- y, Y
- yes, Yes, YES
- Any case variation

This prevents user frustration when typing 'y' instead of full 'yes'.
2025-11-06 15:46:13 -05:00
cschantz 95f9253302 Enhance Acronis installer with advanced/custom mode and better token handling
Added option 5 "Advanced/Custom installation" to installer with:

Interactive Option Builder:
- Unattended mode toggle (auto-accept prompts)
- Registration options:
  * Register with token during install
  * Skip registration (register later)
  * Interactive (let installer prompt)
- Verbose logging flag
- Custom flags input for any additional options
  (proxy, language, bandwidth throttling, etc.)

Improved Token Input:
- Better instructions for obtaining token from web console
- Automatic whitespace/linebreak removal for pasted tokens
- Works with copy-paste from web console
- Handles multi-line paste gracefully

Enhanced Service URL Selection:
- Shows common regions with examples:
  * us5-cloud.acronis.com (US)
  * eu2-cloud.acronis.com (Europe)
  * ap1-cloud.acronis.com (Asia Pacific)
  * ca1-cloud.acronis.com (Canada)
- Only prompts for URL when registration is enabled

Installation Modes Now Available:
1. Interactive installation - guided with prompts
2. Unattended installation - auto-accepts all
3. Install and register with token - one-step setup
4. Install without registration - defer registration
5. Advanced/Custom - build custom flag combination

Example Advanced Mode Usage:
- Select unattended: y
- Registration: option 1 (with token)
- Paste token: [automatically strips spaces]
- Verbose logging: y
- Custom flags: --proxy=http://proxy:8080

All flags are shown in summary before installation proceeds.
2025-11-05 21:39:57 -05:00
cschantz f18e92a48d Add comprehensive Acronis backup troubleshooting tool
Created acronis-troubleshoot.sh with intelligent diagnostic capabilities:

7-Point Diagnostic System:
1. Service Health Check
   - Verifies all 4 Acronis services (aakore, mms, schedule, active-protection)
   - Detects stopped/failed services
   - Auto-generates restart recommendations

2. Disk Space Analysis
   - Checks /var/lib/Acronis and root filesystem
   - Warns at 90%, critical at 95% usage
   - Identifies insufficient space for backups

3. Memory Monitoring
   - Tracks system memory usage
   - Warns at high memory conditions (>90%)
   - Detects potential memory leaks

4. Network Connectivity Testing
   - Tests connection to Acronis Cloud URL
   - DNS resolution verification
   - Identifies firewall/network issues

5. Multi-Location Log Scanning
   - Scans multiple log locations:
     * /var/lib/Acronis/BackupAndRecovery/MMS/mms.*.log
     * /var/log/acronis/agent/*.log
     * System logs (/var/log/messages, /var/log/syslog)
   - Pattern detection for 8 common failure types:
     * Insufficient space errors
     * Permission denied
     * Connection failures
     * Authentication failures
     * Backup task failures
     * VSS/snapshot errors
     * Database errors
     * File locking issues

6. Stuck Process Detection
   - Identifies long-running Acronis processes
   - Detects hung backup jobs
   - Recommends service restarts when needed

7. Configuration Verification
   - Checks backup plan configuration
   - Verifies agent version
   - Registration status validation

Intelligent Recommendations:
- Context-aware fix suggestions based on detected issues
- Prioritized action items (critical vs warnings)
- Specific commands to resolve each issue type

Quick Actions Menu:
1. View all errors from logs
2. Restart all services
3. Generate detailed diagnostic report for support
4. Export logs as tar.gz archive

Issue Tracking:
- Categorizes findings as CRITICAL or WARNINGS
- Provides comprehensive summary with counts
- Color-coded output (red=critical, yellow=warning, green=ok)

Added to Acronis menu as option 12 (Troubleshooting section)

This tool enables rapid diagnosis of backup failures without needing
to manually dig through logs or check multiple system components.
2025-11-05 21:36:13 -05:00
cschantz e7eaabfcc5 Implement Acronis Cyber Protect agent management scripts
Created 11 comprehensive scripts for Acronis backup management:

Installation & Setup:
- acronis-install.sh: Download/install agent with multiple modes
  * Interactive, unattended, with/without registration
  * Supports token-based registration during install
  * Auto-service startup and verification
- acronis-register.sh: Register agent with Acronis Cloud
  * Validates service URL and token
  * Shows current registration status
  * Safe re-registration with confirmation
- acronis-configure.sh: Guidance for backup plan configuration
  * Web console walkthrough
  * Common backup plan examples

Backup Operations:
- acronis-manual-backup.sh: Manual backup creation guide
  * Web console and CLI methods
  * Ready for full CLI implementation
- acronis-status.sh: View backup status from logs
  * Recent backup activity
  * acrocmd integration ready
- acronis-list-backups.sh: List available backup archives
  * acrocmd integration for archive listing
- acronis-restore.sh: Restore from backup guide
  * Multiple restore methods explained
  * Safety warnings and best practices

Management:
- acronis-agent-status.sh: Comprehensive service status
  * All 4 services (aakore, mms, schedule, active-protection)
  * Registration status, network ports, storage
  * Quick actions: start/stop/restart/logs/version
- acronis-update.sh: Agent update management
  * Auto and manual update methods
  * Version checking
- acronis-logs.sh: Advanced log viewer
  * View, tail, search logs
  * Error filtering with color coding
  * Log archival for old logs
- acronis-uninstall.sh: Safe agent removal
  * Stops services, unregisters, removes packages
  * Optional data retention
  * Comprehensive cleanup

All scripts based on documented Acronis commands with proper error
handling, status validation, and user-friendly interfaces.
2025-11-05 21:30:19 -05:00