From 80acdd71faf44bdd2da2ab3e7a777b7859fc5f40 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 15 Apr 2021 10:24:14 +0200 Subject: [PATCH] tape: do not try to backup unfinished backups --- src/api2/tape/backup.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/api2/tape/backup.rs b/src/api2/tape/backup.rs index ec35038a..bce0fbcc 100644 --- a/src/api2/tape/backup.rs +++ b/src/api2/tape/backup.rs @@ -442,7 +442,13 @@ fn backup_worker( progress.done_snapshots = 0; progress.group_snapshots = 0; - let mut snapshot_list = group.list_backups(&datastore.base_path())?; + let snapshot_list = group.list_backups(&datastore.base_path())?; + + // filter out unfinished backups + let mut snapshot_list = snapshot_list + .into_iter() + .filter(|item| item.is_finished()) + .collect(); BackupInfo::sort_list(&mut snapshot_list, true); // oldest first