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