Skip to content

Commit

Permalink
Consider prefix rules when pruning WebDAV storages (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
m90 authored Mar 5, 2022
1 parent 4b1127b commit 5f3832d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/backup/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"os"
"path"
"path/filepath"
"strings"
"text/template"
"time"

Expand Down Expand Up @@ -580,6 +581,9 @@ func (s *script) pruneBackups() error {
var matches []fs.FileInfo
var lenCandidates int
for _, candidate := range candidates {
if !strings.HasPrefix(candidate.Name(), s.c.BackupPruningPrefix) {
continue
}
lenCandidates++
if candidate.ModTime().Before(deadline) {
matches = append(matches, candidate)
Expand Down

0 comments on commit 5f3832d

Please sign in to comment.