public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] tape backup: mention groups that were empty
@ 2021-08-06  9:33 Dominik Csapak
  2021-08-09  7:36 ` [pbs-devel] applied: " Dietmar Maurer
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2021-08-06  9:33 UTC (permalink / raw)
  To: pbs-devel

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@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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-09  7:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06  9:33 [pbs-devel] [PATCH proxmox-backup] tape backup: mention groups that were empty Dominik Csapak
2021-08-09  7:36 ` [pbs-devel] applied: " Dietmar Maurer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal