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:
- create repository in local filesystem
- create repository in Google Cloud Storage bucket
- create repository in S3-compatible bucket (e.g. Amazon S3, minio.io, Wasabi)
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.configon Windows$HOME/Library/Application Support/kopia/repository.configon macOS$HOME/.config/kopia/repository.configon 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).