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
This commit is contained in:
@@ -1,45 +1,76 @@
|
||||
#!/bin/bash
|
||||
|
||||
################################################################################
|
||||
# Acronis List Backups
|
||||
################################################################################
|
||||
# Purpose: List all backups and archives using acrocmd
|
||||
# Features:
|
||||
# - Show backup archives
|
||||
# - Show backup versions
|
||||
# - Display backup details (size, date, location)
|
||||
################################################################################
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
source "$SCRIPT_DIR/lib/common-functions.sh"
|
||||
source "$SCRIPT_DIR/lib/system-detect.sh"
|
||||
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
print_error "This script must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
print_banner "List Available Backups"
|
||||
clear
|
||||
print_banner "List Backups & Archives"
|
||||
|
||||
echo ""
|
||||
echo -e "${BOLD}Available Backups${NC}"
|
||||
echo -e "${BOLD}Retrieving backup information...${NC}"
|
||||
echo ""
|
||||
|
||||
# Check if acrocmd exists
|
||||
if ! command -v acrocmd &>/dev/null; then
|
||||
echo -e "${YELLOW}acrocmd CLI tool not found${NC}"
|
||||
echo ""
|
||||
echo "To list backups:"
|
||||
echo " • Use Acronis web console (recommended)"
|
||||
echo " • Log in and navigate to: Backup → Backup plans"
|
||||
echo " • View all backup archives and recovery points"
|
||||
echo ""
|
||||
echo "Command line option:"
|
||||
echo " acrocmd list archives"
|
||||
echo " acrocmd list recoverypoints"
|
||||
# Check if acrocmd is available
|
||||
if [ ! -f "/usr/sbin/acrocmd" ]; then
|
||||
print_error "acrocmd command-line tool not found"
|
||||
echo ""
|
||||
press_enter
|
||||
exit 0
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Querying backup archives..."
|
||||
# List archives
|
||||
echo -e "${CYAN}════════════════════════════════════════════════════════════${NC}"
|
||||
echo -e "${BOLD}Backup Archives${NC}"
|
||||
echo -e "${CYAN}════════════════════════════════════════════════════════════${NC}"
|
||||
echo ""
|
||||
|
||||
# Try to list archives
|
||||
if acrocmd list archives 2>/dev/null; then
|
||||
echo ""
|
||||
if /usr/sbin/acrocmd list archives 2>/dev/null | grep -q .; then
|
||||
/usr/sbin/acrocmd list archives 2>/dev/null
|
||||
else
|
||||
echo "No archives found or command failed"
|
||||
echo -e "${YELLOW}No backup archives found${NC}"
|
||||
echo ""
|
||||
echo "Possible reasons:"
|
||||
echo " • No backups have been created yet"
|
||||
echo " • Agent not registered with Acronis Cloud"
|
||||
echo " • No backup plans configured"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo -e "${CYAN}════════════════════════════════════════════════════════════${NC}"
|
||||
echo -e "${BOLD}Backup Details${NC}"
|
||||
echo -e "${CYAN}════════════════════════════════════════════════════════════${NC}"
|
||||
echo ""
|
||||
|
||||
if /usr/sbin/acrocmd list backups 2>/dev/null | grep -q .; then
|
||||
/usr/sbin/acrocmd list backups 2>/dev/null
|
||||
else
|
||||
echo -e "${YELLOW}No backup details available${NC}"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo -e "${CYAN}════════════════════════════════════════════════════════════${NC}"
|
||||
echo ""
|
||||
echo -e "${BOLD}Options:${NC}"
|
||||
echo ""
|
||||
echo " • Create backups via 'Trigger Manual Backup'"
|
||||
echo " • Configure plans in Acronis web console"
|
||||
echo " • Check backup status for active operations"
|
||||
echo ""
|
||||
|
||||
press_enter
|
||||
|
||||
Reference in New Issue
Block a user