### Install Kopia UI with Winget Source: https://kopia.io/docs/installation Installs the Kopia GUI (KopiaUI) using the winget package manager. This command installs the official Kopia UI package. ```bash winget install Kopia.KopiaUI ``` -------------------------------- ### Install Kopia or KopiaUI using APT on Linux Source: https://kopia.io/docs/installation Installs either the Kopia CLI or Kopia GUI application using the APT package manager. ```bash sudo apt install kopia sudo apt install kopia-ui ``` -------------------------------- ### Install Kopia port on FreeBSD Source: https://kopia.io/docs/installation Installs Kopia by building it from the ports tree on FreeBSD systems. ```bash cd /usr/ports/sysutils/kopia/ && make install clean ``` -------------------------------- ### Start Kopia Server with TLS Source: https://kopia.io/docs/repository-server Command to start the Kopia server with TLS enabled, required when using a reverse proxy. ```bash kopia server start --address 0.0.0.0:51515 --tls-cert-file ~/my.cert --tls-key-file ~/my.key ``` -------------------------------- ### Kopia Systemd Socket File Example Source: https://kopia.io/docs/repository-server Example systemd socket file for Kopia, demonstrating how to configure socket activation and permissions for Unix domain sockets. ```ini [Unit] Description=Kopia [Socket] ListenStream=%t/kopia/kopia.sock SocketMode=0666 [Install] WantedBy=sockets.target ``` -------------------------------- ### Kopia Configuration File Example Source: https://kopia.io/docs/reference/command-line An example JSON structure for a Kopia repository configuration file. This file stores storage and caching parameters. ```json { "storage": { "type": "s3", "config": { "bucket": "some-bucket", "endpoint": "s3.endpoint.com", "accessKeyID": "...", "secretAccessKey": "..." } }, "caching": { "cacheDirectory": "/kopia/7c04ae89ea31e77d-1", "maxCacheSize": 524288000, "maxListCacheDuration": 600 } } ``` -------------------------------- ### Install Kopia binary using an AUR helper on Arch/Manjaro Source: https://kopia.io/docs/installation Installs the Kopia binary package using an AUR helper like 'yay'. ```bash yay -S kopia-bin ``` -------------------------------- ### Install Kopia GUI using Homebrew on macOS Source: https://kopia.io/docs/installation Use this command to install the Kopia GUI application via Homebrew. ```bash $ brew install kopiaui ``` -------------------------------- ### Build and install Kopia binary from source using AUR on Arch/Manjaro Source: https://kopia.io/docs/installation Clones the Kopia binary AUR repository, builds the package from source, and installs it. ```bash git clone https://aur.archlinux.org/kopia-bin.git cd kopia-bin makepkg -si ``` -------------------------------- ### Install Kopia package on OpenBSD Source: https://kopia.io/docs/installation Installs the Kopia package directly on OpenBSD systems. ```bash # pkg_add kopia ``` -------------------------------- ### Build and install Kopia from source using AUR on Arch/Manjaro Source: https://kopia.io/docs/installation Clones the Kopia AUR repository, builds the package from source, and installs it. ```bash git clone https://aur.archlinux.org/kopia.git cd kopia makepkg -si ``` -------------------------------- ### Begin Repository Upgrade Source: https://kopia.io/docs/reference/command-line/advanced/repository-upgrade-begin Initiates the repository upgrade process. Use this command to start the upgrade and optionally configure parameters like I/O drain timeout and maximum clock drift. ```bash $ kopia repository upgrade begin ``` -------------------------------- ### Install Kopia using an AUR helper on Arch/Manjaro Source: https://kopia.io/docs/installation Installs Kopia using an AUR helper like 'yay'. ```bash yay -S kopia ``` -------------------------------- ### Make Kopia Binary Executable and Install Source: https://kopia.io/docs/installation Instructions for Linux/macOS to make the downloaded Kopia binary executable and move it to a system PATH directory for easy command-line access. ```bash # make the file executable $ chmod u+x path/to/kopia # move to a location in system path $ sudo mv path/to/kopia /usr/local/bin/kopia ``` -------------------------------- ### Install Kopia CLI using Homebrew on macOS Source: https://kopia.io/docs/installation Use this command to install the Kopia command-line interface via Homebrew. ```bash $ brew install kopia ``` -------------------------------- ### Install Kopia Binary with Go Source: https://kopia.io/docs/installation Use this command to download and build a basic Kopia binary if you have Go 1.16 or newer. The binary will be placed in your Go bin directory. This version lacks HTML-based UI support. ```bash $ go install github.com/kopia/kopia@latest ``` -------------------------------- ### Install Kopia or KopiaUI using RPM on Linux Source: https://kopia.io/docs/installation Installs either the Kopia CLI or Kopia GUI application using the yum/dnf package manager. ```bash sudo yum install kopia sudo yum install kopia-ui ``` -------------------------------- ### Start Kopia Repository Server with Auto-Generated TLS Source: https://kopia.io/docs/repository-server Start the Kopia repository server for the first time using auto-generated TLS certificates. This command requires setting repository and server control passwords as environment variables. The generated certificate SHA256 fingerprint will be displayed and is needed for client connections. ```bash KOPIA_PASSWORD="" \ KOPIA_SERVER_CONTROL_PASSWORD="" \ kopia server start \ --tls-generate-cert \ --tls-cert-file ~/my.cert \ --tls-key-file ~/my.key \ --address 0.0.0.0:51515 \ --server-control-username control ``` ```text SERVER CERT SHA256: 48537cce585fed39fb26c639eb8ef38143592ba4b4e7677a84a31916398d40f7 ``` -------------------------------- ### Install Kopia Folder Actions Source: https://kopia.io/docs/advanced/actions Sets the before and after folder actions for a target directory in Kopia policy. Ensure the script paths are correct. ```shell kopia policy set --before-folder-action "powershell -WindowStyle Hidden -File \before.ps1" kopia policy set --after-folder-action "powershell -WindowStyle Hidden -File \after.ps1" ``` -------------------------------- ### Build Full Kopia Binary with Make Source: https://kopia.io/docs/installation To create a Kopia binary that includes all features, including HTML-based UI support, download the source from GitHub and run this command. Ensure you have the necessary build tools installed. ```bash $ make install ``` -------------------------------- ### Install Kopia CLI with Winget Source: https://kopia.io/docs/installation Installs Kopia CLI using the winget package manager, which is preinstalled on Windows 11 and available on Windows 10. This command installs the official Kopia CLI package. ```bash winget install Kopia.KopiaCLI ``` -------------------------------- ### Create Kopia Repository Source: https://kopia.io/docs/reference/command-line Use this command to create a new Kopia repository with a specified provider and flags. Examples include local filesystem, Google Cloud Storage, and S3-compatible storage. ```bash $ kopia repository create ``` -------------------------------- ### Troubleshoot Windows Mount Error (Status 2) Source: https://kopia.io/docs/mounting Demonstrates troubleshooting a 'status 2' mount error on Windows, which often relates to the 'WebClient' service. This includes checking the service status, attempting to start it, and reconfiguring it to 'Demand' start. ```powershell kopia mount all Z: # unable to mount kopia.exe: error: mount error: unable to mount webdav server as drive letter: unable to run 'net use' (): error running 'net use': exit status 2, try --help sc start WebClient # attempt to start the service failed [SC] StartService FAILED 1058: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. sc config WebClient start= demand # change the service from Disabled to Demand start. can also be done in "Services" [SC] ChangeServiceConfig SUCCESS kopia mount all Z: # mount successful Mounted 'all' on Z: Press Ctrl-C to unmount. ``` -------------------------------- ### Install latest unreleased Kopia CLI using Homebrew on macOS Source: https://kopia.io/docs/installation Install the latest unreleased version of Kopia by tapping a specific Homebrew repository. ```bash $ brew install kopia/test-builds/kopia ``` -------------------------------- ### Start Kopia Server with Unix Domain Socket Source: https://kopia.io/docs/repository-server Command to start the Kopia server using a Unix domain socket, often used with reverse proxies for local communication. ```bash kopia server start --address unix:/tmp/kopia.sock --tls-cert-file ~/my.cert --tls-key-file ~/my.key ``` -------------------------------- ### Create Repository From Configuration Source: https://kopia.io/docs/reference/command-line/common/repository-create-from-config Use this command to create a new Kopia repository by specifying a configuration file. This method is useful for automating repository setup or using pre-defined configurations. ```bash kopia repository create from-config ``` -------------------------------- ### Install Kopia RPM repository on Linux Source: https://kopia.io/docs/installation Configures the Kopia RPM repository for use with yum/dnf. Supports stable, testing, and unstable channels. ```bash cat < ### Description Info about particular user. ### Arguments #### Path Parameters - **username** (string) - Required - The username to look up. ``` -------------------------------- ### Upgrade Kopia CLI using Homebrew on macOS Source: https://kopia.io/docs/installation Use this command to upgrade an existing Kopia installation managed by Homebrew. ```bash $ brew upgrade kopia ``` -------------------------------- ### Upgrade Kopia GUI using Homebrew on macOS Source: https://kopia.io/docs/installation Use this command to upgrade an existing Kopia GUI installation managed by Homebrew. ```bash $ brew upgrade kopiaui ``` -------------------------------- ### List Notification Templates Source: https://kopia.io/docs/reference/command-line/common/notification-template-list Run this command to list all available notification templates. Use the `--json` flag for machine-readable output. ```bash kopia notification template list ``` -------------------------------- ### Create Filesystem Repository Source: https://kopia.io/docs/reference/command-line/common/repository-create-filesystem Use this command to create a new Kopia repository in a specified directory on your filesystem. Replace '...' with the desired path. ```bash $ kopia repository create filesystem \ --path=... ``` -------------------------------- ### Prefetch a specific object into cache Source: https://kopia.io/docs/reference/command-line/advanced/cache-prefetch This command prefetches a specified object ID into the cache. You can optionally provide a hint to guide the prefetching process. ```APIDOC ## kopia cache prefetch ### Description Prefetches the provided objects into cache. ### Method CLI Command ### Endpoint N/A (CLI command) ### Parameters #### Path Parameters - **object** (string) - Required - Object ID to prefetch #### Query Parameters - **--hint** (string) - Optional - Prefetch hint ``` -------------------------------- ### Create Rclone Repository Source: https://kopia.io/docs/reference/command-line/common/repository-create-rclone Use this command to create a new Kopia repository backed by an rclone remote path. Ensure rclone is installed and configured. ```bash $ kopia repository create rclone \ --remote-path=... ``` -------------------------------- ### Create Snapshot with Advanced Options Source: https://kopia.io/docs/reference/command-line/common/snapshot-create Creates a snapshot using advanced options such as forcing hash calculation for a percentage of files and enabling streaming reads for reduced memory footprint on Linux. ```bash kopia snapshot create /path/to/directory --force-hash 10.0 --hint-streaming-reads ``` -------------------------------- ### Get Kopia Server Status Source: https://kopia.io/docs/reference/command-line/common/server-status Execute this command to view the current status of the Kopia server. It displays connection details and available configuration flags. ```bash $ kopia server status ``` -------------------------------- ### Connect to WebDAV Repository Source: https://kopia.io/docs/reference/command-line/common/repository-connect-webdav Use this command to connect to a WebDAV repository. Ensure you provide the correct URL for your WebDAV server. ```bash $ kopia repository connect webdav \ --url=... ``` -------------------------------- ### Get Repository Throttling Parameters Source: https://kopia.io/docs/reference/command-line/common/repository-throttle-get Use this command to retrieve the current throttling parameters configured for the repository. The output can be formatted as JSON for programmatic use. ```bash $ kopia repository throttle get ``` -------------------------------- ### List Contents in JSON Format Source: https://kopia.io/docs/reference/command-line/advanced/content-list To get the output in JSON format, use the `--json` flag. This is useful for programmatic processing of the content list. ```bash $ kopia content list --json ``` -------------------------------- ### Create Google Drive Repository CLI Source: https://kopia.io/docs/repositories Use this command to create a new Kopia repository on Google Drive. Ensure you have the folder ID and the path to your service account JSON key file. ```bash $ kopia repository create gdrive \ --folder-id z63ZZ1Npv3OFvDPwU3dX0w \ --credentials-file="" ``` -------------------------------- ### GC Blobs with a Specific Prefix Source: https://kopia.io/docs/reference/command-line/advanced/blob-gc Limit the garbage collection process to only consider blobs that start with a specified prefix. This can be useful for managing specific sets of data. ```bash kopia blob gc --prefix "my-data/" ``` -------------------------------- ### Log in to Google Cloud SDK Source: https://kopia.io/docs/repositories Before creating a GCS repository using the CLI, authenticate with Google Cloud SDK. This command initiates the login process. ```bash $ gcloud auth application-default login ``` -------------------------------- ### Get Repository Throttling Parameters Source: https://kopia.io/docs/reference/command-line/common/repository-throttle-get Retrieves the current throttling parameters configured for the repository. This command provides insights into rate limiting applied to repository operations. ```APIDOC ## kopia repository throttle get ### Description Get throttling parameters for a repository. ### Method GET (conceptual) ### Endpoint N/A (CLI command) ### Parameters #### Command-line Flags - `--json` (boolean) - Optional - Output result in JSON format to stdout. Default: `false` - `--json-indent` (boolean) - Optional - [ADV] Output result in indented JSON format to stdout. Default: `false` - `--json-verbose` (boolean) - Optional - [ADV] Output non-essential data (e.g. statistics) in JSON format. Default: `false` ### Request Example ```bash kopia repository throttle get ``` ### Response #### Success Response (200) - The response will detail the current throttling parameters. The exact structure depends on the output format (JSON or plain text). #### Response Example (Plain Text - conceptual) ``` (Throttling parameters will be displayed here) ``` #### Response Example (JSON - conceptual) ```json { "example": "{\"uploadLimit\": 1000000, \"downloadLimit\": 1000000, \"concurrentUploads\": 5, \"concurrentDownloads\": 5}" } ``` ``` -------------------------------- ### Show All Logs Source: https://kopia.io/docs/reference/command-line/advanced/logs-show Use the --all flag to display all available log entries, overriding the default behavior of showing only the last log. ```bash $ kopia logs show --all ``` -------------------------------- ### Summarize Repository Contents Source: https://kopia.io/docs/reference/command-line/advanced/content-list To get a summary of the repository contents instead of a detailed list, use the `--summary` or `-s` flag. This provides aggregate information. ```bash $ kopia content list -s ``` -------------------------------- ### List Repository Policies Source: https://kopia.io/docs/reference/command-line/common/policy-list Use this command to view all policies currently applied to the repository. Policies define rules for backups, such as retention and snapshots. ```bash $ kopia policy list ``` -------------------------------- ### Create Filesystem Repository via Kopia CLI Source: https://kopia.io/docs/repositories Use this command to create a new Kopia repository stored on a local or network-attached filesystem. Specify the desired path for the repository data. ```bash $ kopia repository create filesystem --path=... ``` -------------------------------- ### Nginx Configuration with Unix Domain Sockets for Kopia Source: https://kopia.io/docs/repository-server Example Nginx configuration using Unix domain sockets to connect to a Kopia server. This is an alternative to TCP/IP connections. ```nginx upstream socket { server unix:///tmp/kopia.sock; } server { listen 443 ssl http2; server_name mydomain.com; ssl_certificate_key /path/to/your/key.key; ssl_certificate /path/to/your/cert.crt; client_max_body_size 0; # Allow unlimited upload size location / { grpc_pass grpcs://socket; # Adapt if your kopia is running on another server } } ``` -------------------------------- ### Import Policies from File or Stdin Source: https://kopia.io/docs/reference/command-line/common/policy-import Imports policies from a specified file or standard input if no file is provided. Use flags to control behavior like allowing unknown fields or deleting existing policies. ```bash kopia policy import [target] ``` -------------------------------- ### Nginx Reverse Proxy Configuration for Kopia Source: https://kopia.io/docs/repository-server Example Nginx configuration to proxy requests to a Kopia server running on localhost. Ensure GRPC is used and TLS is enabled. ```nginx server { listen 443 ssl http2; server_name mydomain.com; ssl_certificate_key /path/to/your/key.key; ssl_certificate /path/to/your/cert.crt; client_max_body_size 0; # Allow unlimited upload size location / { grpc_pass grpcs://localhost:51515; # Adapt if your kopia is running on another server } } ``` -------------------------------- ### Show Logs Younger Than a Specific Time Source: https://kopia.io/docs/reference/command-line/advanced/logs-show Filter logs to include only those younger than a specified duration using the --younger-than flag. For example, '1h' for one hour. ```bash $ kopia logs show --younger-than 1h ``` -------------------------------- ### Windows Shadow Copy Before Action (PowerShell) Source: https://kopia.io/docs/advanced/actions Creates a Windows Shadow Copy for a volume and mounts it as a directory, allowing Kopia to back up files with exclusive locks. Self-elevates to administrator if needed. ```powershell if ($args.Length -eq 0) { $kopiaSnapshotId = $env:KOPIA_SNAPSHOT_ID $kopiaSourcePath = $env:KOPIA_SOURCE_PATH } else { $kopiaSnapshotId = $args[0] $kopiaSourcePath = $args[1] } $sourceDrive = Split-Path -Qualifier $kopiaSourcePath $sourcePath = Split-Path -NoQualifier $kopiaSourcePath # use Kopia snapshot ID as mount point name for extra caution for duplication $mountPoint = "${PSScriptRoot}\${kopiaSnapshotId}" if (([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) { $shadowId = (Invoke-CimMethod -ClassName Win32_ShadowCopy -MethodName Create -Arguments @{ Volume = "${sourceDrive}\" }).ShadowID $shadowDevice = (Get-CimInstance -ClassName Win32_ShadowCopy | Where-Object { $_.ID -eq $shadowId }).DeviceObject if (-not $shadowDevice) { # fail the Kopia snapshot early if shadow copy was not created exit 1 } cmd /c mklink /d $mountPoint "${shadowDevice}\" } else { $proc = Start-Process 'powershell' '-f', $MyInvocation.MyCommand.Path, $kopiaSnapshotId, $kopiaSourcePath -PassThru -Verb RunAs -WindowStyle Hidden -Wait if ($proc.ExitCode) { exit $proc.ExitCode } } Write-Output "KOPIA_SNAPSHOT_PATH=${mountPoint}${sourcePath}" ``` -------------------------------- ### Show Logs Older Than a Specific Time Source: https://kopia.io/docs/reference/command-line/advanced/logs-show Filter logs to include only those older than a specified duration using the --older-than flag. For example, '1h' for one hour. ```bash $ kopia logs show --older-than 1h ``` -------------------------------- ### Modify Source Path with Before Action Source: https://kopia.io/docs/advanced/actions An example of a 'before-folder' action script that dumps a SQL database into the source directory before it is snapshotted. It uses environment variables provided by Kopia. ```bash #!/bin/sh set -e mysqldump SomeDatabase --result-file=$KOPIA_SOURCE_PATH/dump.sql ``` -------------------------------- ### Get Info for a Specific User Source: https://kopia.io/docs/reference/command-line/common/server-users-info Use this command to retrieve detailed information about a particular user on the Kopia server. Replace '' with the actual username you want to query. ```bash kopia server users info ``` -------------------------------- ### Create Google Drive Repository Source: https://kopia.io/docs/reference/command-line/common/repository-create-gdrive Use this command to create a new Kopia repository in a specified Google Drive folder. Ensure you have the necessary permissions and have configured Google Drive access. ```bash kopia repository create gdrive \ --folder-id=... ``` -------------------------------- ### Output maintenance info in JSON format Source: https://kopia.io/docs/reference/command-line/advanced/maintenance-info Use the `--json` flag to get maintenance information in a machine-readable JSON format. This is useful for scripting or integrating with other tools. ```bash $ kopia maintenance info --json ``` -------------------------------- ### Run Compression Benchmarks Source: https://kopia.io/docs/reference/command-line/common/benchmark-compression Execute compression benchmarks using a specified data file. This command helps in evaluating the performance of different compression algorithms. ```bash $ kopia benchmark compression \ --data-file=... ``` -------------------------------- ### Enable Kopia Server ACL Mode Source: https://kopia.io/docs/repository-server Run this command to enable ACL mode and install default ACL entries. This command is necessary before managing custom ACL rules. ```bash $ kopia server acl enable ``` -------------------------------- ### Connect to SFTP Repository Source: https://kopia.io/docs/reference/command-line/common/repository-connect-sftp Use this command to establish a connection to your Kopia repository over SFTP. Ensure you replace the placeholder values with your actual SFTP server details. ```bash $ kopia repository connect sftp \ --path=... \ --host=... \ --username=... ``` -------------------------------- ### Enable Server ACLs Source: https://kopia.io/docs/reference/command-line/common/server-acl-enable Use this command to enable ACLs for the Kopia server and install default entries. The `--reset` flag can be used to reset all ACLs to their default values. ```bash kopia server acl enable ``` -------------------------------- ### Example Pull Request Title Format Source: https://kopia.io/docs/contribution-guidelines Follow this precise format for pull request titles to ensure compatibility with automated checks. It includes type, domain, and a clear description. ```text feat(cli): Add new policy rule --new-feature-x to enable using feature x ``` -------------------------------- ### List Content Indexes with Summary and Superseded Files Source: https://kopia.io/docs/reference/command-line/advanced/index-list Include a summary of each index blob and display superseded index files that have been replaced by compaction. ```bash $ kopia index list --summary --superseded ``` -------------------------------- ### Output Repository Status in JSON Source: https://kopia.io/docs/reference/command-line/common/repository-status To get the repository status in a machine-readable JSON format, use the `--json` flag. This is helpful for scripting and integrating Kopia status into other tools. ```bash $ kopia repository status --json ``` -------------------------------- ### Create Snapshot with Parallel Uploads Source: https://kopia.io/docs/reference/command-line/common/snapshot-create Creates a snapshot while uploading up to 4 files in parallel to optimize transfer speed. The default value for parallel uploads is 0, meaning no parallel uploads. ```bash kopia snapshot create /path/to/directory --parallel 4 ``` -------------------------------- ### Sync Repository to Filesystem Source: https://kopia.io/docs/reference/command-line/common/repository-sync-to-filesystem Synchronizes repository data to a specified filesystem path. Use the `--path` flag to indicate the destination directory. Options like `--delete` and `--dry-run` can modify the synchronization behavior. ```bash $ kopia repository sync-to filesystem \ --path=... ``` -------------------------------- ### List Kopia Server ACL Rules Source: https://kopia.io/docs/repository-server View the currently installed ACL rules in the repository. Each rule has a unique ID, specifies the user, access level, and target manifests it applies to. ```bash $ kopia server acl list id:c95e5a13b0b0fc874e550677f5e89262 user:*@* access:APPEND target:type=content id:633f998af93e00c715e6417cb41df0af user:*@* access:READ target:type=policy,policyType=global id:de21ac7a55ec1d9cf939b4cb158cc85a user:*@* access:READ target:type=policy,hostname=OWN_HOST,policyType=host id:2314795d54060ab84cdc7fcb6e6953c8 user:*@* access:FULL target:type=policy,username=OWN_USER,hostname=OWN_HOST id:0245e5bc1eca296e775e137a9587d09e user:*@* access:FULL target:type=snapshot,hostname=OWN_HOST,username=OWN_USER id:fb043d9e77299e182e9297d0f4601d9b user:*@* access:FULL target:type=user,username=OWN_USER@OWN_HOST ```