Skip to content

Commit 5f3832d

Browse files
authored
Consider prefix rules when pruning WebDAV storages (#79)
1 parent 4b1127b commit 5f3832d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/backup/script.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"os"
1313
"path"
1414
"path/filepath"
15+
"strings"
1516
"text/template"
1617
"time"
1718

@@ -580,6 +581,9 @@ func (s *script) pruneBackups() error {
580581
var matches []fs.FileInfo
581582
var lenCandidates int
582583
for _, candidate := range candidates {
584+
if !strings.HasPrefix(candidate.Name(), s.c.BackupPruningPrefix) {
585+
continue
586+
}
583587
lenCandidates++
584588
if candidate.ModTime().Before(deadline) {
585589
matches = append(matches, candidate)

0 commit comments

Comments
 (0)