mirror of https://github.com/restic/restic.git
Merge pull request #3607 from jtagcat/quieter_cleanup
logging: quiet 'removing n old cache dirs'
This commit is contained in:
commit
8832837a8a
|
@ -502,8 +502,9 @@ func OpenRepository(opts GlobalOptions) (*repository.Repository, error) {
|
||||||
|
|
||||||
// cleanup old cache dirs if instructed to do so
|
// cleanup old cache dirs if instructed to do so
|
||||||
if opts.CleanupCache {
|
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 {
|
for _, item := range oldCacheDirs {
|
||||||
dir := filepath.Join(c.Base, item.Name())
|
dir := filepath.Join(c.Base, item.Name())
|
||||||
err = fs.RemoveAll(dir)
|
err = fs.RemoveAll(dir)
|
||||||
|
|
Loading…
Reference in New Issue