Merge pull request #3474 from kitone/fix-issue-3382

Honor RESTIC_CACHE_DIR environment variable
This commit is contained in:
MichaelEischer
2021-11-07 17:57:54 +01:00
committed by GitHub
5 changed files with 27 additions and 3 deletions
+4
View File
@@ -10,6 +10,7 @@ import (
"github.com/spf13/cobra"
"github.com/restic/restic/internal/cache"
"github.com/restic/restic/internal/checker"
"github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/fs"
@@ -158,6 +159,9 @@ func prepareCheckCache(opts CheckOptions, gopts *GlobalOptions) (cleanup func())
}
cachedir := gopts.CacheDir
if cachedir == "" {
cachedir = cache.EnvDir()
}
// use a cache in a temporary directory
tempdir, err := ioutil.TempDir(cachedir, "restic-check-cache-")