feat: prune backups of uninstalled apps during incremental backup#126
Open
mvanhorn wants to merge 1 commit into
Open
feat: prune backups of uninstalled apps during incremental backup#126mvanhorn wants to merge 1 commit into
mvanhorn wants to merge 1 commit into
Conversation
Owner
|
The script is currently undergoing extensive refactoring and feature additions. I will merge this commit once it is stable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an opt-in
prune_uninstalledsetting so a re-run of backup also reflects app removals, not just additions. When enabled, after a backup completes the script compares the backed-up app folders against the live installed-package list and offers to delete the backups of apps that have been uninstalled since the last run (folder + itsappList.txtentry).prune_uninstalled(default0, off) in bothupdate_backup_settings_conf(tools/tools.sh) andbackup_settings.conf.prune_uninstalled_backups()reuses the existing detection idiom fromget_name(PackageName-vs-$Apk_infodiff) and the existing per-name folder +appList.txtdeletion idiom.Why this matters
Per #124, re-running a backup today adds newly installed apps but never drops the stored copy of an app that was uninstalled since the last run, so a later restore re-installs apps the user removed. This implements the reporter's requested behavior (compare previous vs current app set, drop backups of apps no longer installed).
Safety:
Testing
bash -n tools/tools.shpasses.prune_uninstalled=1→ A's folder and itsappList.txtline are removed after confirmation.prune_uninstalled=0(default) → uninstalled app's backup retained as today, no prompt.Fixes #124