ff640ca9ef5d9f27e346e8f8f6a2cbabee8f224d
This commit introduces several major improvements to the handling of encrypted incremental backups.
1. **Fix LUKS Container Resize:**
The `encryption_helper.sh` script has been fixed to reliably resize LUKS containers. The `cryptsetup resize` command now correctly re-authenticates, resolving an issue where the script would fail because it was incorrectly trying to read a password from an empty stdin stream.
2. **Refactor Backup Directory Structure:**
The storage path for encrypted user backups has been flattened. Backups are now stored directly in the encrypted mount point (e.g., `/backup/pybackup/encrypted_videos/BACKUP_NAME`) instead of a deeply nested folder (`.../user/SOURCE_NAME/BACKUP_NAME`). This simplifies the directory structure as requested.
3. **Correct Incremental Size Estimation:**
The `estimate_incremental_size` function is now more robust.
- The `rsync` command for user backups now correctly uses a trailing slash on the source path.
- This ensures the `--link-dest` comparison works as intended against the new, flat directory structure, leading to an accurate calculation of the required incremental size.
4. **Refine Container Resize Trigger and Logic:**
The logic for automatically resizing encrypted containers in `encryption_manager.py` has been completely overhauled to prevent excessive growth:
- A resize is now only triggered if the projected free space after a backup would fall below a 4 GB buffer.
- The calculation for the new size now correctly adds the required space plus the 4 GB buffer, ensuring sufficient space without over-provisioning.
Py-Backup
Screenshots
Instruction
Languages
Python
97.8%
Shell
2.2%