mirror of
https://github.com/restic/restic.git
synced 2024-12-24 08:44:52 +00:00
restic cache should display the name of the cache without shortening it in the case of the restic check
This commit is contained in:
parent
0425a30420
commit
5904f80cfa
1 changed files with 7 additions and 1 deletions
|
@ -5,6 +5,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/restic/restic/internal/cache"
|
"github.com/restic/restic/internal/cache"
|
||||||
|
@ -140,8 +141,13 @@ func runCache(opts CacheOptions, gopts GlobalOptions, args []string) error {
|
||||||
size = fmt.Sprintf("%11s", formatBytes(uint64(bytes)))
|
size = fmt.Sprintf("%11s", formatBytes(uint64(bytes)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
name := entry.Name()
|
||||||
|
if !strings.HasPrefix(name, "restic-check-cache-") {
|
||||||
|
name = name[:10]
|
||||||
|
}
|
||||||
|
|
||||||
tab.AddRow(data{
|
tab.AddRow(data{
|
||||||
entry.Name()[:10],
|
name,
|
||||||
fmt.Sprintf("%d days ago", uint(time.Since(entry.ModTime()).Hours()/24)),
|
fmt.Sprintf("%d days ago", uint(time.Since(entry.ModTime()).Hours()/24)),
|
||||||
old,
|
old,
|
||||||
size,
|
size,
|
||||||
|
|
Loading…
Reference in a new issue