2
2
mirror of https://github.com/octoleo/restic.git synced 2024-06-06 11:00:48 +00:00

Merge pull request #3607 from jtagcat/quieter_cleanup

logging: quiet 'removing n old cache dirs'
This commit is contained in:
MichaelEischer 2021-12-29 16:06:35 +01:00 committed by GitHub
commit 8832837a8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -502,8 +502,9 @@ func OpenRepository(opts GlobalOptions) (*repository.Repository, error) {
// cleanup old cache dirs if instructed to do so
if opts.CleanupCache {
Printf("removing %d old cache dirs from %v\n", len(oldCacheDirs), c.Base)
if stdoutIsTerminal() && !opts.JSON {
Verbosef("removing %d old cache dirs from %v\n", len(oldCacheDirs), c.Base)
}
for _, item := range oldCacheDirs {
dir := filepath.Join(c.Base, item.Name())
err = fs.RemoveAll(dir)