Skip to content

Kopia backup

Issues / PR

Install

Installatio docs

Kopia's apt repo supports also RPi OS (armv7l) as well as RockPro64 (aarch64)

curl -s https://kopia.io/signing-key | sudo gpg --dearmor -o /usr/share/keyrings/kopia-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/kopia-keyring.gpg] http://packages.kopia.io/apt/ stable main" | sudo tee /etc/apt/sources.list.d/kopia.list
sudo apt update
sudo apt install kopia-ui kopia

or:

UI: flatpak install KopiaUI cli: brew install kopia

Arch: pamac install kopia-bin

Usage

Multiple repo configs

Connect repo:

kopia repository connect s3 \
  --access-key=$(gopass show --password token/s3.k.varac.net/varac/velero/accesskey) \
  --secret-access-key=$(gopass show --password token/s3.k.varac.net/varac/velero/secretkey) \
  --bucket=velero --endpoint=s3.k.varac.net \
  --prefix=k.varac.net-kopia/kopia/vaultwarden/

The above cmd will create 2 config file in ~/.config/kopia/:

  • repository.config
  • repository.config.kopia-password

Rename them so they are associated with their backup profile:

mv repository.config repository-velero-plausible.config
mv repository.config.kopia-password repository-velero-plausible.config.kopia-password

Then use the new config files:

export KOPIA_CONFIG_PATH=~/.config/kopia/repository-velero-plausible.config
kopia repository status -t -s

List snapshots:

kopia snapshot list

Show diff between snapshots:

kopia diff kb9a8420bf6b8ea280d6637ad1adbd4c5 ke2e07d38a8a902ad07eda5d2d0d3025d

List files in snapshot:

kopia ls -l kb9a8420bf6b8ea280d6637ad1adbd4c5

Backup

Ignore files

Restore

Mounting is currently the recommended way of restoring files/directories from snapshots. However, you can also use the kopia snapshot restore command to restore files/directories from snapshots.

kopia mount k2a873c512333066f449eea7b75c750ae /tmp/mnt
cp /tmp/mnt/… /tmp/restore

Monitoring

Ansible