2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-22 12:55:18 +00:00

cache --cleanup should handle directories created by restic check.

Because there is no guarantee that a cleanup of these directories will occur
after the "restic check", we extend the behavior to detect and manage these
specific cache directories and allow their cleanup too.
This commit is contained in:
kitone 2021-11-04 14:48:01 +01:00
parent 95eb859b54
commit 1b23675f21

View File

@ -172,7 +172,7 @@ func updateTimestamp(d string) error {
const MaxCacheAge = 30 * 24 * time.Hour
func validCacheDirName(s string) bool {
r := regexp.MustCompile(`^[a-fA-F0-9]{64}$`)
r := regexp.MustCompile(`^[a-fA-F0-9]{64}$|^restic-check-cache-[0-9]+$`)
return r.MatchString(s)
}