[PR #118] [MERGED] feat: Add backup and restore functionality for scripts directories #197

Closed
opened 2025-11-20 04:13:27 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE-Local/pull/118
Author: @michelroegl-brunner
Created: 10/13/2025
Status: Merged
Merged: 10/13/2025
Merged by: @michelroegl-brunner

Base: mainHead: feature/backup-restore-scripts-directories


📝 Commits (1)

  • b473e11 feat: Add backup and restore functionality for scripts directories

📊 Changes

1 file changed (+76 additions, -2 deletions)

View changed files

📝 update.sh (+76 -2)

📄 Description

Description

This PR enhances the update.sh script to backup and restore the scripts directories (ct/, install/, tools/, vm/) during the update process.

Changes Made

🔧 Enhanced Functions

  • backup_data(): Added backup logic for all four scripts directories
  • restore_backup_files(): Added restore logic for scripts directories after update
  • rollback(): Enhanced to restore scripts directories on update failure

🛡️ Protection Mechanisms

  • Exclude patterns: Updated to preserve scripts directories during file updates
  • Directory preservation: Scripts directories are excluded from being overwritten
  • Error handling: Comprehensive error checking and logging throughout

📁 Directories Protected

  • scripts/ct/ - Container templates
  • scripts/install/ - Installation scripts
  • scripts/tools/ - Utility tools
  • scripts/vm/ - Virtual machine scripts

Benefits

Data Preservation: Custom scripts are never lost during updates
Safe Updates: Scripts are backed up before and restored after updates
Rollback Support: Failed updates restore all scripts from backup
Comprehensive Logging: Full visibility into backup/restore operations

Testing

  • Script syntax validation passed
  • No linting errors
  • Backup/restore logic verified
  • Exclude patterns tested

Backward Compatibility

This change is fully backward compatible and doesn't affect existing functionality.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE-Local/pull/118 **Author:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Created:** 10/13/2025 **Status:** ✅ Merged **Merged:** 10/13/2025 **Merged by:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Base:** `main` ← **Head:** `feature/backup-restore-scripts-directories` --- ### 📝 Commits (1) - [`b473e11`](https://github.com/community-scripts/ProxmoxVE-Local/commit/b473e11b9c58dac5eafe2b30fe7fe1c32f2733cb) feat: Add backup and restore functionality for scripts directories ### 📊 Changes **1 file changed** (+76 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `update.sh` (+76 -2) </details> ### 📄 Description ## Description This PR enhances the update.sh script to backup and restore the scripts directories (ct/, install/, tools/, vm/) during the update process. ## Changes Made ### 🔧 Enhanced Functions - **backup_data()**: Added backup logic for all four scripts directories - **restore_backup_files()**: Added restore logic for scripts directories after update - **rollback()**: Enhanced to restore scripts directories on update failure ### 🛡️ Protection Mechanisms - **Exclude patterns**: Updated to preserve scripts directories during file updates - **Directory preservation**: Scripts directories are excluded from being overwritten - **Error handling**: Comprehensive error checking and logging throughout ### 📁 Directories Protected - `scripts/ct/` - Container templates - `scripts/install/` - Installation scripts - `scripts/tools/` - Utility tools - `scripts/vm/` - Virtual machine scripts ## Benefits ✅ **Data Preservation**: Custom scripts are never lost during updates ✅ **Safe Updates**: Scripts are backed up before and restored after updates ✅ **Rollback Support**: Failed updates restore all scripts from backup ✅ **Comprehensive Logging**: Full visibility into backup/restore operations ## Testing - [x] Script syntax validation passed - [x] No linting errors - [x] Backup/restore logic verified - [x] Exclude patterns tested ## Backward Compatibility This change is fully backward compatible and doesn't affect existing functionality. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 04:13:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE-Local#197