github tis24dev/proxsave v0.7.1

latest releases: v0.11.15, v0.11.14, v0.11.13...
one month ago

๐ŸŽฏ v0.7.1 โ€” Selective Restore with Intelligent Detection

This release introduces selective restore functionality with automatic version detection and interactive category selection.
It focuses on granular restore control, performance optimization, installation improvements, and 100% backward compatibility with legacy backups.


๐Ÿ”„ Restore Script

/script/proxmox-restore.sh

Added

  • ๐ŸŽฏ Implemented selective restore functionality with interactive category selection menu (4 modes: Full/Storage/System Base/Custom).
  • ๐Ÿ” Added automatic backup version detection system using metadata files.
  • ๐Ÿ“‹ Added 14 new functions for comprehensive restore capabilities:
    • detect_backup_version() โ€” Detects selective restore support via metadata
    • analyze_backup_categories() โ€” Scans backup for available configuration categories
    • show_category_menu() โ€” Interactive menu with Full/Storage/Base/Custom/Cancel options
    • show_custom_selection_menu() โ€” Advanced multi-select interface for granular category selection
    • get_category_paths() โ€” Maps 15+ categories (PVE/PBS/common) to filesystem paths
    • restore_selective() โ€” Performs selective restore using rsync with automatic backup
    • recreate_storage_directories() โ€” Creates PVE storage and PBS datastore directory structures
    • read_backup_metadata() โ€” Reads metadata directly from compressed archives without extraction
    • get_backup_type_label() โ€” Returns backup type label for menu display (e.g., "Selettivo / PBS")
    • prepare_restore_context() โ€” Prepares restore environment (download, extraction, strategy)
    • prepare_restore_strategy() โ€” Collects user restore preferences before confirmation
    • execute_restore_strategy() โ€” Executes restore operation after user confirmation
    • cleanup_temp_resources() โ€” Cleans up temporary extraction directories
    • get_display_proxmox_type() โ€” Returns uppercase display name for Proxmox type
    • validate_system_compatibility() โ€” Prevents incompatible cross-system restores (PVE โ†” PBS)
  • ๐Ÿ—๏ธ Added automatic directory structure recreation for PVE storages and PBS datastores:
    • Parses /etc/pve/storage.cfg to create storage directories with standard subdirectories
    • Parses /etc/proxmox-backup/datastore.cfg to create datastore directories with .chunks
    • Sets correct ownership (root:root for PVE, backup:backup for PBS) and permissions (755/750)
  • ๐Ÿท๏ธ Added backup type detection and display:
    • Reads BACKUP_TYPE field from metadata (pve/pbs/both/mixed)
    • Displays type in backup selection menu: "Selettivo / PBS" or "Standard / PVE"
    • Shows detected system type in confirmation screen
    • Fallback to filename detection (pve-backup-* or pbs-backup-*) if metadata unavailable
  • ๐Ÿ“Š Added comprehensive restore confirmation screen showing:
    • Storage location and backup filename
    • Backup type from catalog (via fast metadata read)
    • Detected system type (PVE/PBS/Unknown)
    • Backup version and selective restore support status
    • Selected restore mode (Full/Selective)
    • List of selected categories with human-readable names and descriptions
  • ๐Ÿ”„ Implemented new restore workflow architecture:
    • Separation of preparation and execution phases for better UX
    • User selects restore categories BEFORE final confirmation
    • Ability to cancel after seeing available options without side effects
    • Cleanup of temporary resources if user cancels at any stage
  • โšก Added metadata reading optimization:
    • Reads metadata directly from compressed archives (tar.zst/tar.xz/tar.gz/tar.bz2/tar)
    • Works with local, secondary, and cloud storage (via rclone cat)
    • Significantly improves performance when browsing backup catalog
  • ๐Ÿ”’ Replaced manual cp operations with rsync -a --backup --backup-dir for safer restore operations.
  • ๐Ÿ’พ Added backup of overwritten files to timestamped directory: /tmp/current_config_backup_YYYYMMDD_HHMMSS_PID.
  • ๐Ÿ”ค Added support for uppercase PROXMOX_TYPE display using parameter expansion ${PROXMOX_TYPE^^}.
  • โœ… Added validation checks using [[ -v AVAILABLE_CATEGORIES[$cat] ]] for compatibility with set -o nounset.
  • ๐ŸŽจ Added dynamic menu text in show_category_menu() that adapts to PVE vs PBS backup type.

Fixed

  • ๐Ÿ”ง Modified main restore workflow to use new prepare/execute architecture instead of inline restore.
  • ๐Ÿ”™ Fixed show_category_menu() to return exit code 1 when user cancels (option 0).
  • ๐Ÿ›ก๏ธ Fixed array key existence checks to use [[ -v array[key] ]] for set -u compatibility.
  • ๐Ÿ“ค Fixed extract_backup() output to use stderr redirection (>&2) for status messages.
  • ๐Ÿ”€ Fixed option 2 incorrectly mixing PVE and PBS categories (now properly separated by backup type).
  • ๐Ÿท๏ธ Fixed menu showing generic "STORAGE only" label for both PVE and PBS (now shows system-specific labels).
  • โ™ป๏ธ Maintains 100% backward compatibility: legacy backups without metadata automatically use full restore mode.

Security

  • ๐Ÿ›ก๏ธ Blocks incompatible restore attempts (PVE backup โ†’ PBS system or vice versa) with detailed error messages.
  • ๐Ÿ”’ Prevents system malfunction from cross-system configuration restoration.
  • โœ… Validates backup type matches current system before allowing restore to proceed.

Behavior

  • ๐Ÿ†• Modern backups (with metadata):
    • Interactive menu offering Full/Storage/System Base/Custom restore options
    • Backup type displayed in selection menu (e.g., "pbs-backup-2025-11-03.tar.xz (7.9M) [Selettivo / PBS]")
    • User can select specific categories before confirming restore
    • Comprehensive confirmation screen shows all selected options
    • System compatibility validation prevents cross-system restores
  • ๐Ÿ“ฆ Legacy backups (without metadata):
    • Automatic full restore with no user interaction for category selection
    • Displayed as "Standard / Unknown" in backup menu
  • โšก Quick restore mode: Restores storage-related configurations (PVE cluster, storage, jobs, PBS datastores)
  • ๐Ÿ”ง System Base mode: Restores essential configurations only (network, SSL, SSH, systemd services)
  • ๐ŸŽจ Custom restore mode: Granular selection of specific categories with interactive toggle interface
  • ๐Ÿ”„ All restore operations use rsync with automatic backup of existing files before overwriting
  • ๐Ÿงน Temporary resources automatically cleaned up on cancellation or error

๐Ÿ“š Core Libraries

/lib/backup_collect.sh

Added

  • ๐Ÿ“ Added create_backup_metadata() function to generate backup metadata files.
  • ๐Ÿ”— Integrated metadata creation into backup workflow (called after file collection completes).
  • ๐Ÿ“‹ Metadata file includes:
    • Backup version, type (PVE/PBS), timestamp, hostname
    • Feature flags: SUPPORTS_SELECTIVE_RESTORE=true
    • Capability list: selective_restore,category_mapping,version_detection,auto_directory_creation

/lib/security.sh

Changed

  • ๐Ÿ”ง Removed dependency installation logic โ€” Moved to install.sh for centralized management.
  • ๐Ÿ”ง Added automatic Debian repository management to recover from missing mirrors during dependency installation.

Behavior

  • Security module now focuses exclusively on security checks and validation.
  • Dependency installation handled by install.sh during initial setup and updates.

โš™๏ธ Configuration

/env/backup.env

Added

  • ๐Ÿ“ฆ Added rsync to REQUIRED_PACKAGES list for automatic installation during dependency checks.
  • โœ… rsync requirement ensures selective restore functionality works on all systems.

Fixed

  • ๐Ÿ”ง Updated dependency list from "tar gzip zstd pigz jq curl rclone gpg" to include rsync.

๐Ÿงฐ Standalone Scripts

/install.sh

Added

  • ๐Ÿ“ฆ Added rsync dependency to installation requirements.
  • ๐Ÿ’ฌ Added interactive Telegram notifications setup during installation:
    • User-friendly prompt indicating setup "takes only a few seconds"
    • Automatic configuration of TELEGRAM_ENABLED variable in backup.env based on user choice
    • Automatic backup creation before modifying configuration file
    • New function prompt_telegram_notifications() integrated after setup_configuration()
  • ๐Ÿ”ง Completely rewrote rclone installation/update logic (lines 254-292):
    • Downloads rclone install script to temporary file before execution (safer approach)
    • Uses case statement for clean exit code handling:
      • Exit code 0 = installation/update successful
      • Exit code 3 = already at latest version (now handled correctly!)
      • Other codes = genuine errors
    • Removed problematic "always update" behavior that caused false errors
    • Eliminated set +e/set -e toggling that conflicted with global error trap
    • Fixed silent failures when rclone already up-to-date
  • ๐Ÿ”ง Improved dependency management by centralizing package installation logic from security.sh.

Fixed

  • ๐Ÿ› Fixed critical bug where script would fail with error when rclone was already at the latest version.
  • ๐Ÿ› Fixed exit code 3 handling โ€” Now correctly recognizes "already at latest version" as success.
  • ๐Ÿ› Fixed silent script termination after rclone update due to trap ERR conflicts.
  • ๐Ÿ”ง Simplified installation flow by removing redundant version checks and complex conditional logic.

Behavior

  • ๐Ÿ†• rclone installation:
    • If not installed โ†’ Installs latest version
    • If installed but outdated โ†’ Updates to latest version
    • If already at latest version โ†’ Shows success message and continues (no longer fails!)
  • ๐Ÿ†• rsync installation:
    • Same intelligent behavior as before (version 3.4.1 target)
    • Maintains proper version comparison and compilation from source
  • ๐Ÿ’ฌ Telegram setup:
    • Interactive prompt during installation workflow
    • Skips prompt during non-interactive/automated installations

โœ… Overall Improvements

  • ๐ŸŽฏ Selective restore with 4 modes: Full, Storage-only, System Base, Custom selection.
  • ๐Ÿ” Automatic version detection with intelligent fallback to full restore for legacy backups.
  • โšก Performance boost: metadata reading without full archive extraction.
  • ๐Ÿท๏ธ Enhanced UX: backup type labels in menus (Selettivo/Standard, PVE/PBS).
  • ๐Ÿ“Š Comprehensive confirmation screen with all restore details before execution.
  • ๐Ÿ—๏ธ Automatic directory recreation for storage/datastore structures.
  • ๐Ÿ”’ Safer restore operations with rsync and automatic backup of overwritten files.
  • ๐Ÿ›ก๏ธ Cross-system restore protection prevents incompatible configuration restoration.
  • โ™ป๏ธ 100% backward compatibility with legacy backups.
  • ๐Ÿงน Intelligent resource management with automatic cleanup on cancellation.
  • ๐Ÿ› Fixed rclone installation bugs that caused false errors when already up-to-date.
  • ๐Ÿ’ฌ Streamlined Telegram setup with interactive configuration during installation.
  • ๐Ÿ”ง Improved installer robustness with centralized dependency management.

โœจ Result: The restore system now offers granular control over what gets restored, with intelligent detection, performance optimization, and complete backward compatibility. Installation process is more robust and user-friendly.


Compatibility: PVE and PBS
Installation: bash -c "$(curl -fsSL https://raw.githubusercontent.com/tis24dev/proxmox-backup/main/install.sh)"

Don't miss a new proxsave release

NewReleases is sending notifications on new releases.