fix: PBS Backup-Count robusteres find-Pattern fuer alle Namespace-Strukturen
This commit is contained in:
parent
5995f2e9cc
commit
6487c2cf59
@ -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: <path>/<type>/<id>/<timestamp> oder <path>/ns/<ns>/<type>/<id>/<timestamp>
|
||||
// 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user