diff --git a/pbs-datastore/src/prune.rs b/pbs-datastore/src/prune.rs index 70c3d91c..0eaa8acd 100644 --- a/pbs-datastore/src/prune.rs +++ b/pbs-datastore/src/prune.rs @@ -7,7 +7,7 @@ use pbs_api_types::PruneOptions; use super::BackupInfo; -enum PruneMark { Keep, KeepPartial, Remove } +enum PruneMark { Protected, Keep, KeepPartial, Remove } fn mark_selections Result> ( mark: &mut HashMap, @@ -30,6 +30,10 @@ fn mark_selections Result> ( for info in list { let backup_id = info.backup_dir.relative_path(); if mark.get(&backup_id).is_some() { continue; } + if info.protected { + mark.insert(backup_id, PruneMark::Protected); + continue; + } let sel_id: String = select_id(&info)?; if already_included.contains(&sel_id) { continue; }