[pbs-devel] [PATCH proxmox-backup] tape backup: mention groups that were empty

Dominik Csapak d.csapak at proxmox.com
Fri Aug 6 11:33:45 CEST 2021


otherwise a user might get a task log like this:

-----
...
found 7 groups
TASK OK
-----

which could confuse the users as why there were no snapshots backed up

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/api2/tape/backup.rs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/api2/tape/backup.rs b/src/api2/tape/backup.rs
index 9f815cad..9d1ece40 100644
--- a/src/api2/tape/backup.rs
+++ b/src/api2/tape/backup.rs
@@ -486,11 +486,16 @@ fn backup_worker(
         let snapshot_list = group.list_backups(&datastore.base_path())?;
 
         // filter out unfinished backups
-        let mut snapshot_list = snapshot_list
+        let mut snapshot_list: Vec<_> = snapshot_list
             .into_iter()
             .filter(|item| item.is_finished())
             .collect();
 
+        if snapshot_list.is_empty() {
+            task_log!(worker, "group {} was empty", group);
+            continue;
+        }
+
         BackupInfo::sort_list(&mut snapshot_list, true); // oldest first
 
         if latest_only {
-- 
2.30.2






More information about the pbs-devel mailing list