From 6487c2cf5999c5e23b6d3aa9b349ac692efb4616 Mon Sep 17 00:00:00 2001 From: cynfo3000 Date: Fri, 6 Mar 2026 23:58:16 +0100 Subject: [PATCH] fix: PBS Backup-Count robusteres find-Pattern fuer alle Namespace-Strukturen --- agent-linux/collector/pbs.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/agent-linux/collector/pbs.go b/agent-linux/collector/pbs.go index 27fd131..865c79e 100644 --- a/agent-linux/collector/pbs.go +++ b/agent-linux/collector/pbs.go @@ -90,12 +90,12 @@ func CollectPBS() *PBSInfo { if avail, ok := d["avail"].(float64); ok { ds.Available = int64(avail) } - // Backup-Anzahl: Zeitstempel-Verzeichnisse zaehlen (depth 3 ohne ns, depth 5 mit ns) + // Backup-Anzahl: alle Timestamp-Verzeichnisse zaehlen // Struktur: /// oder /ns//// + // Timestamp-Format: 2026-02-18T18:24:36Z if ds.Path != "" { - // Alle Timestamp-Verzeichnisse: entweder depth 3 (ohne ns) oder depth 5 (mit ns) countCmd := exec.Command("/bin/sh", "-c", - "find "+ds.Path+" \\( -mindepth 3 -maxdepth 3 -o -mindepth 5 -maxdepth 5 \\) -type d 2>/dev/null | grep -cE '^.*[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$'") + `find `+ds.Path+` -type d 2>/dev/null | grep -cE '/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$'`) if out, err := countCmd.Output(); err == nil { if n, err := strconv.Atoi(strings.TrimSpace(string(out))); err == nil { ds.BackupCount = n