Prevent pruning of snapshots without an associated cleanup policy from borg archive #15
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.
Solves #13
This PR changes the naming convention to depend on snapper cleanup policy for the snapshot. If there is any associated cleanup policy, the backup's name will start with
snapborg_retentionpolicy_Only backups whose name start with
snapborg_retentionpolicy_will be pruned,snapborg prunewill ignore all others. In case this is undesired, an additional flag--ignore-nameprefix-warning-this-is-permanentexists to apply pruning to all backups in the archive.This PR also comes with a
--noconfirmflag to bypass the confirmation prompt associated with applying pruning to all snapshots.The reasoning here is that when users manually create snapshots (-> no backup policy), it must be because the system state was of interest. It's therefore worthwhile backing up that snapshot and keeping it indefinitely - or at least until the user manually deletes it.
I'm unsure if this is compatible with your personal use case - would it be better to NOT have this behavior by default, but instead to implement this functionality as an additional field in the snapper userdata that the user can manually specify?