summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorAlexander Neumann <alexander@bumpern.de>2015-11-08 21:24:51 +0100
committerAlexander Neumann <alexander@bumpern.de>2015-11-08 21:24:51 +0100
commit43e2c9837ef3fd104b80737b71288730e0f85f48 (patch)
tree743de546bd22c96b19dc281f503540a677c78a47 /cmd
parentc4fc7b52ae06c17545692d4fdbc2c2071c849086 (diff)
check: removing orphaned packs is handled in 'optimize'
Diffstat (limited to 'cmd')
-rw-r--r--cmd/restic/cmd_check.go24
1 files changed, 2 insertions, 22 deletions
diff --git a/cmd/restic/cmd_check.go b/cmd/restic/cmd_check.go
index e8e54aa37..a94ad138b 100644
--- a/cmd/restic/cmd_check.go
+++ b/cmd/restic/cmd_check.go
@@ -5,14 +5,12 @@ import (
"fmt"
"os"
- "github.com/restic/restic/backend"
"github.com/restic/restic/checker"
)
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"`
- CheckUnused bool `long:"check-unused" description:"Check for unused blobs" default:"false"`
+ ReadData bool `long:"read-data" description:"Read data blobs" default:"false"`
+ CheckUnused bool `long:"check-unused" description:"Check for unused blobs" default:"false"`
global *GlobalOptions
}
@@ -81,14 +79,9 @@ func (cmd CmdCheck) Execute(args []string) error {
cmd.global.Verbosef("Check all packs\n")
go chkr.Packs(errChan, done)
- foundOrphanedPacks := false
for err := range errChan {
errorsFound = true
fmt.Fprintf(os.Stderr, "%v\n", err)
-
- if e, ok := err.(checker.PackError); ok && e.Orphaned {
- foundOrphanedPacks = true
- }
}
cmd.global.Verbosef("Check snapshots, trees and blobs\n")
@@ -114,19 +107,6 @@ func (cmd CmdCheck) Execute(args []string) error {
}
}
- if foundOrphanedPacks && cmd.RemoveOrphaned {
- IDs := chkr.OrphanedPacks()
- cmd.global.Verbosef("Remove %d orphaned packs... ", len(IDs))
-
- for _, id := range IDs {
- if err := repo.Backend().Remove(backend.Data, id.String()); err != nil {
- fmt.Fprintf(os.Stderr, "%v\n", err)
- }
- }
-
- cmd.global.Verbosef("done\n")
- }
-
if errorsFound {
return errors.New("repository contains errors")
}