summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorAlexander Neumann <alexander@bumpern.de>2015-11-08 20:46:52 +0100
committerAlexander Neumann <alexander@bumpern.de>2015-11-08 20:46:52 +0100
commitcd948b56aca7bc79fc3532787a364b5638a541ee (patch)
tree926fb56717870d873b02a4859066a638762cd991 /cmd
parentdb41102bfab02c7f8b9b77b883ebe7aaed79de18 (diff)
cmd_check: Don't display unused blobs by default
Diffstat (limited to 'cmd')
-rw-r--r--cmd/restic/cmd_check.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/cmd/restic/cmd_check.go b/cmd/restic/cmd_check.go
index 919568618..e8e54aa37 100644
--- a/cmd/restic/cmd_check.go
+++ b/cmd/restic/cmd_check.go
@@ -10,8 +10,9 @@ import (
)
type CmdCheck struct {
- ReadData bool `long:"read-data" description:"Read data blobs" default:"false"`
- RemoveOrphaned bool `long:"remove" description:"Remove data that isn't used" default:"false"`
+ ReadData bool `long:"read-data" description:"Read data blobs" default:"false"`
+ RemoveOrphaned bool `long:"remove" description:"Remove data that isn't used" default:"false"`
+ CheckUnused bool `long:"check-unused" description:"Check for unused blobs" default:"false"`
global *GlobalOptions
}
@@ -106,8 +107,11 @@ func (cmd CmdCheck) Execute(args []string) error {
}
}
- for _, id := range chkr.UnusedBlobs() {
- cmd.global.Verbosef("unused blob %v\n", id.Str())
+ if cmd.CheckUnused {
+ for _, id := range chkr.UnusedBlobs() {
+ cmd.global.Verbosef("unused blob %v\n", id.Str())
+ errorsFound = true
+ }
}
if foundOrphanedPacks && cmd.RemoveOrphaned {