reference the datastore in BackupGroup/Dir

And drop the base_path parameter on a first bunch of
functions (more reordering will follow).

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2022-04-20 15:30:04 +02:00
parent bb628c295a
commit 6da20161f0
13 changed files with 230 additions and 87 deletions

View File

@ -44,7 +44,7 @@ pub fn prune_datastore(
for group in datastore.iter_backup_groups()? {
let group = group?;
let list = group.list_backups(&datastore.base_path())?;
let list = group.list_backups()?;
if !has_privs && !datastore.owns_backup(group.as_ref(), &auth_id)? {
continue;

View File

@ -663,13 +663,13 @@ pub async fn pull_group(
if params.remove_vanished {
let group = params.store.backup_group(group.clone());
let local_list = group.list_backups(&params.store.base_path())?;
let local_list = group.list_backups()?;
for info in local_list {
let backup_time = info.backup_dir.backup_time();
if remote_snapshots.contains(&backup_time) {
continue;
}
if info.backup_dir.is_protected(params.store.base_path()) {
if info.backup_dir.is_protected() {
task_log!(
worker,
"don't delete vanished snapshot {:?} (protected)",