MCPcopy
hub / github.com/kopia/kopia / setup

Method setup

cli/command_logs_cleanup.go:20–29  ·  view source on GitHub ↗
(svc appServices, parent commandParent)

Source from the content-addressed store, hash-verified

18}
19
20func (c *commandLogsCleanup) setup(svc appServices, parent commandParent) {
21 cmd := parent.Command("cleanup", "Clean up logs")
22
23 cmd.Flag("max-age", "Maximal age").Default("720h").DurationVar(&c.maxAge)
24 cmd.Flag("max-count", "Maximal number of files to keep").Default("10000").IntVar(&c.maxCount)
25 cmd.Flag("max-total-size-mb", "Maximal total size in MiB").Default("1024").Int64Var(&c.maxTotalSizeMB)
26 cmd.Flag("dry-run", "Do not delete").BoolVar(&c.dryRun)
27
28 cmd.Action(svc.directRepositoryWriteAction(c.run))
29}
30
31func (c *commandLogsCleanup) run(ctx context.Context, rep repo.DirectRepositoryWriter) error {
32 rep.LogManager().Disable()

Callers

nothing calls this directly

Calls 2

CommandMethod · 0.80

Tested by

no test coverage detected