backupexample

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command backupexample is chunk 0.6's proof of REPO-2/REPO-3: it backs up a seeded Exchange mailbox and lists the resulting backup point using nothing but src/pkg/engine (and the handful of other src/pkg packages needed to build its inputs - pkg/account, pkg/storage, pkg/selectors, pkg/control, pkg/credentials). It imports no src/internal package - see TestExample_ImportsNoInternalPackage in this directory, which parses this file's own import block and fails the build if that ever stops being true. That test is the point of this program; everything else here is just enough plumbing to make it a real, runnable backup rather than a stub.

Like every program under src/cmd, this is where reading the process environment belongs - src/pkg/engine itself never does. Required:

AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET - a Microsoft 365
  application's credentials (the same three chunk 0.3's seeder and test
  tenant harness use).
SEED_USER_ID - the licensed M365 user chunk 0.3 seeded; this program
  backs up that user's Exchange Inbox.

Optional:

BACKUPEXAMPLE_REPO_PATH - a filesystem directory for the Kopia
  repository. Defaults to a fresh temporary directory.

Required, with no default - review flagged a hardcoded fallback passphrase in an earlier version of this file as exactly the kind of thing that gets copied into real code, and example code is what gets copied:

BACKUPEXAMPLE_PASSPHRASE - the repository's encryption key. No
  default: this program fails closed rather than silently backing a
  real mailbox up under a passphrase anyone reading this file also
  knows.

Run from src/ with:

GO111MODULE=on GOWORK=off go run ./cmd/backupexample

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL