Files
kopia/site/content/docs/Reference/Command-Line/_index.md
Jarek Kowalski 2787011e02 Revamped kopia.io website.
Added build pipeline to keep the reference in sync with the code.
2019-05-09 22:11:03 -07:00

2.3 KiB

title, linkTitle, weight
title linkTitle weight
Command Line Command Line 10

Kopia provides a command-line interface (CLI) for accessing all its functions. All commands are accessible through single binary called kopia (or kopia.exe on Windows).

Kopia functionality is organized into Common Commands for typical use or Advanced Commands for low-level data manipulation or recovery. Click on the above links for more details.

Connecting to Repository

Most commands require a Repository to be connected first. The first time you use Kopia, repository must be created, later on it can be connected to from one or more machines.

Creating a repository is as simple as:

$ kopia repository create <provider> <flags>

Examples:

To connect to an existing repository use the same flags but instead of create use connect:

$ kopia repository connect <provider> <flags>

To disconnect:

$ kopia repository disconnect

Configuration File

For each repository connection, Kopia maintains a configuration file and local cache:

By default the configuration file is located in your home directory under:

  • %APPDATA%\kopia\repository.config on Windows
  • $HOME/Library/Application Support/kopia/repository.config on macOS
  • $HOME/.config/kopia/repository.config on Linux

The location can be overridden using --config-path.

The configuration file stores the connection parameters, for example:

{
  "storage": {
    "type": "s3",
    "config": {
      "bucket": "some-bucket",
      "endpoint": "s3.endpoint.com",
      "accessKeyID": "...",
      "secretAccessKey": "..."
    }
  },
  "caching": {
    "cacheDirectory": "<path-to>/kopia/7c04ae89ea31e77d-1",
    "maxCacheSize": 524288000,
    "maxListCacheDuration": 600
  }
}

The password to the repository is stored in operating-system specific credential storage (KeyChain on macOS, Credential Manager on Windows or KeyRing on Linux).