MCPcopy
hub / github.com/kopia/kopia / reportSnapshotStatus

Method reportSnapshotStatus

cli/command_snapshot_create.go:392–419  ·  view source on GitHub ↗
(ctx context.Context, manifest *snapshot.Manifest)

Source from the content-addressed store, hash-verified

390}
391
392func (c *commandSnapshotCreate) reportSnapshotStatus(ctx context.Context, manifest *snapshot.Manifest) error {
393 var maybePartial string
394 if manifest.IncompleteReason != "" {
395 maybePartial = " partial"
396 }
397
398 sourceInfo := manifest.Source
399
400 snapID := manifest.ID
401
402 if c.jo.jsonOutput {
403 c.out.printStdout("%s\n", c.jo.jsonIndentedBytes(manifest, " "))
404 } else {
405 log(ctx).Infof("Created%v snapshot with root %v and ID %v in %v", maybePartial, manifest.RootObjectID(), snapID, manifest.EndTime.Sub(manifest.StartTime).Truncate(time.Second))
406 }
407
408 if ds := manifest.RootEntry.DirSummary; ds != nil {
409 if ds.IgnoredErrorCount > 0 {
410 log(ctx).Warnf("Ignored %v error(s) while snapshotting %v.", ds.IgnoredErrorCount, sourceInfo)
411 }
412
413 if ds.FatalErrorCount > 0 {
414 return errors.Errorf("Found %v fatal error(s) while snapshotting %v.", ds.FatalErrorCount, sourceInfo) //nolint:revive
415 }
416 }
417
418 return nil
419}
420
421func getLocalBackupPaths(ctx context.Context, rep repo.Repository) ([]string, error) {
422 log(ctx).Debugf("Looking for previous backups of '%v@%v'...", rep.ClientOptions().Hostname, rep.ClientOptions().Username)

Callers 1

snapshotSingleSourceMethod · 0.95

Calls 5

printStdoutMethod · 0.80
jsonIndentedBytesMethod · 0.80
RootObjectIDMethod · 0.80
SubMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected