From 1b23675f215a113d522033582f573fc5ab079638 Mon Sep 17 00:00:00 2001 From: kitone Date: Thu, 4 Nov 2021 14:48:01 +0100 Subject: [PATCH] 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. --- internal/cache/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cache/cache.go b/internal/cache/cache.go index 48b175df1..bc82675d3 100644 --- a/internal/cache/cache.go +++ b/internal/cache/cache.go @@ -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) }