diff --git a/cmd/restic/global.go b/cmd/restic/global.go index 6827f512d..d472d8a34 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -388,8 +388,10 @@ func OpenRepository(opts GlobalOptions) (*repository.Repository, error) { } } } else { - Verbosef("found %d old cache directories in %v, pass --cleanup-cache to remove them\n", - len(oldCacheDirs), c.Base) + if stdoutIsTerminal() { + Verbosef("found %d old cache directories in %v, pass --cleanup-cache to remove them\n", + len(oldCacheDirs), c.Base) + } } return s, nil