Requesting advice "best practices" for adding Kopia command line

I’m been using the GUI exclusively and have tested it with a restore. All seems to be working fine.

But now I wish to extend Kopia through the command line interface. Just what is the proper way to add it to Windows and Linux machines?

Did look for this information but may be suffering from “optical rectitus” (head up my ass). Did not find anything related to a parallel installation.

Any help is appreciated. This is very useful software and it has solved many problems here.

“parallel installation”? what is that…

Can you explain in simple term what you want to achieve?

I wish to use KopiaUI 90% of the time. Then use Kopia command line for maintenance tasks.

Problem example: This is what happens when I try to use apt install for my Ubuntu type distro. And yes, I had believed the Kopia repository was already installed.

sudo apt install kopia
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package kopia

Same thing with Windows. How do I gain access to those non GUI commands?

RTFM

So certain of yourself. Bet there’s a lifelong thread here. Your mother knew.

Is this correct for your version of ubuntu?

curl -s https://kopia.io/signing-key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/kopia-keyring.gpg

This did install the public key, but when I run the " ```
sudo apt install kopia" I get this error:


E: Malformed entry 1 in list file /etc/apt/sources.list.d/kopia.list (Component)
E: The list of sources could not be read.

On my windows 11 system where I installed koipiaui, I found the kopia executable at the following location:
“C:\Users\[username]\AppData\Local\Programs\KopiaUI\resources\server\kopia.exe”

Thanks for the clue. performed a search on the Windows box and found it… Wasn’t totally certain the command line component was already installed. That’s why I was attempting a new install.

Kopia UI installs into Linux through the normal repositories, but when you attempt to install Kopia command line through the app’s repository - it sends many things into the wrong folders. I can’t get Kopia’s app-get to work at all for me. Perhaps I’ll get lucky and find that the command line version is already installed :slight_smile: Thanks to you.

I just tried installing kopia-ui into an ubuntu vm. I don’t believe that the ui installation installs the cli.

larry@larry-Virtual-Machine:~$ locate kopia
/etc/alternatives/kopia-ui
/etc/apt/keyrings/kopia-keyring.gpg
/etc/apt/sources.list.d/kopia.list
/opt/KopiaUI/kopia-ui
/opt/KopiaUI/resources/icons/kopia-tray.png
/opt/KopiaUI/resources/server/kopia
/usr/bin/kopia-ui
/usr/share/applications/kopia-ui.desktop
/usr/share/doc/kopia-ui
/usr/share/doc/kopia-ui/changelog.gz
/usr/share/icons/hicolor/128x128/apps/kopia-ui.png
/usr/share/icons/hicolor/16x16/apps/kopia-ui.png
/usr/share/icons/hicolor/256x256/apps/kopia-ui.png
/usr/share/icons/hicolor/32x32/apps/kopia-ui.png
/usr/share/icons/hicolor/48x48/apps/kopia-ui.png
/usr/share/icons/hicolor/512x512/apps/kopia-ui.png
/usr/share/icons/hicolor/64x64/apps/kopia-ui.png
/var/lib/apt/lists/packages.kopia.io_apt_dists_stable_InRelease
/var/lib/apt/lists/packages.kopia.io_apt_dists_stable_main_binary-amd64_Packages
/var/lib/dpkg/alternatives/kopia-ui
/var/lib/dpkg/info/kopia-ui.list
/var/lib/dpkg/info/kopia-ui.md5sums
/var/lib/dpkg/info/kopia-ui.postinst
/var/lib/dpkg/info/kopia-ui.postrm

After installing the kopia CLI (sudo apt install kopia), I found it in /usr/bin/kopia

Now, looking at your error above, I suspect there is some junk in the file /etc/apt/sources.list.d/kopia.list

When you first ran “curl -s https://kopia.io/signing-key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/kopia-keyring.gpg”, are you sure it completed ok? On my fresh system, I got an error that curl needed to be installed so I had to do that first prior in order for this command to sucessfully complete.

Arrgh. Ran into so many problems with the Linux install - set it aside for now.

I am running verify on the windows box and it’s turning up a few errors like this: error reading object Ix05fc847b7a55f9f6d558a9f6480c3885: unable to read data: unexpected content error: invalid checksum at pf5dd84bfb38cd08b5dff9b94b8108c95-s3fb22b878abee0d912b offset 6421820 length 2132136/2132136: decrypt: unable to decrypt content: cipher: message authentication failed
Processed 16517 objects.
Finished processing 16528 objects.
ERROR error reading object Ix05fc847b7a55f9f6d558a9f6480c3885: unable to read data: unexpected content error: invalid checksum at pf5dd84bfb38cd08b5dff9b94b8108c95-s3fb22b878abee0d912b offset 6421820 length 2132136/2132136: decrypt: unable to decrypt content: cipher: message authentication failed

I’ve successfully cleared one of these errors by deleting the bad file then resnapshotting prior to re-verify. But the “cure” was very inelegant, and I can’t remember exactly what I did to make it go away :slight_smile:

I wish that kopia would just log errors then continue, but that does not seem to be an option.

Do know that the “ignore errors” field within kopiaui does work, because I’ve had no problems executing a full restore.

I’m relatively new to Kopia, so don’t take my advice as gospel, but it’s my understanding that you should only delete a bad file as a last resort. Prior to that, you’d want to try kopia snapshot fix invalid-files. See: https://kopia.discourse.group/t/best-method-to-ensure-valid-snapshots-snapshot-verify-vs-snapshot-fix-invalid-files

What am I missing here? Should I rerun this command with the --commit flag?

kopia snapshot fix invalid-files
Listing blobs…
10000 blobs…
20000 blobs…
30000 blobs…
40000 blobs…
50000 blobs…
60000 blobs…
70000 blobs…
80000 blobs…
90000 blobs…
100000 blobs…
110000 blobs…
120000 blobs…
130000 blobs…
140000 blobs…
150000 blobs…
160000 blobs…
170000 blobs…
180000 blobs…
190000 blobs…
200000 blobs…
210000 blobs…
220000 blobs…
230000 blobs…
240000 blobs…
250000 blobs…
260000 blobs…
270000 blobs…
280000 blobs…
290000 blobs…
300000 blobs…
310000 blobs…
320000 blobs…
330000 blobs…
340000 blobs…
350000 blobs…
360000 blobs…
370000 blobs…
380000 blobs…
390000 blobs…
400000 blobs…
410000 blobs…
420000 blobs…
430000 blobs…
440000 blobs…
450000 blobs…
460000 blobs…
470000 blobs…
480000 blobs…
490000 blobs…
500000 blobs…
510000 blobs…
520000 blobs…
530000 blobs…
540000 blobs…
550000 blobs…
560000 blobs…
570000 blobs…
580000 blobs…
590000 blobs…
600000 blobs…
610000 blobs…
620000 blobs…
630000 blobs…
640000 blobs…
650000 blobs…
660000 blobs…
670000 blobs…
680000 blobs…
690000 blobs…
700000 blobs…
710000 blobs…
Listed 713203 blobs.
Listing all snapshots…
Processing snapshot User@desktop-kh0mk6g:G:
2024-08-16 22:23:24 CDT replaced manifest from 16a59d079cf30f8f5354773941b9e176 to 16a59d079cf30f8f5354773941b9e176
diff k12993d26008a0ef69cef23a35390073f k73d24d6a36e8d3244b343cba2d6f4b1a
2024-08-22 14:22:45 CDT replaced manifest from 341784e762a3212ec0a34a6e4b8393e0 to 341784e762a3212ec0a34a6e4b8393e0
diff k12993d26008a0ef69cef23a35390073f k73d24d6a36e8d3244b343cba2d6f4b1a
2024-08-29 01:38:59 CDT replaced manifest from b7ec0c7e5d95915f123da589accc5ef4 to b7ec0c7e5d95915f123da589accc5ef4
diff k12993d26008a0ef69cef23a35390073f k73d24d6a36e8d3244b343cba2d6f4b1a
2024-08-30 17:13:08 CDT replaced manifest from f0ea9967a9e3af8f4d77cca7714dee6c to f0ea9967a9e3af8f4d77cca7714dee6c
diff kd2e1a9e53a393a39947bf1858a3a2ee1 k563dde8d4e5424e510c9b49a3dddba61
2024-08-31 15:37:34 CDT replaced manifest from 3d3756f1a44ad3a363c7a860f3b86600 to 3d3756f1a44ad3a363c7a860f3b86600
diff kd2e1a9e53a393a39947bf1858a3a2ee1 k563dde8d4e5424e510c9b49a3dddba61
2024-08-31 16:32:16 CDT replaced manifest from 779a322eb5d2667b1666ef3c4a29f848 to 779a322eb5d2667b1666ef3c4a29f848
diff kd2e1a9e53a393a39947bf1858a3a2ee1 k563dde8d4e5424e510c9b49a3dddba61
2024-08-31 21:51:42 CDT replaced manifest from b1996041602d2bd29f5a866550890ddb to b1996041602d2bd29f5a866550890ddb
diff kd2e1a9e53a393a39947bf1858a3a2ee1 k563dde8d4e5424e510c9b49a3dddba61
2024-09-01 23:52:02 CDT replaced manifest from 80ce8eb93c4148da1c90b8a5e0520ee4 to 80ce8eb93c4148da1c90b8a5e0520ee4
diff kd2e1a9e53a393a39947bf1858a3a2ee1 k563dde8d4e5424e510c9b49a3dddba61
2024-09-13 20:12:03 CDT replaced manifest from d8f8885e14a4d9acf430a3dffd6d1211 to d8f8885e14a4d9acf430a3dffd6d1211
diff kf290ab52553cfd8b53f6d4938672100c k8c76441f5091bdefe6bd815860904095
2024-09-24 20:09:02 CDT replaced manifest from 0353c34668b4bb1b6c59e347ff13f311 to 0353c34668b4bb1b6c59e347ff13f311
diff k55b5cba2c1625773a522573c8f18e51c k6a9ad5afbfb62fe1fa27ac55fb3c316b
Processing snapshot User@desktop-kh0mk6g:M:\Backup
2024-08-22 14:29:27 CDT unchanged (b2f7d8135cb63eaa18c5a53f88b09d5a)
2024-08-29 00:18:32 CDT unchanged (964193bc964d408568e31d805cbbe6b4)
2024-09-05 00:28:32 CDT unchanged (9a4c2ae58fc74f216eae626dc5bea7d8)
2024-09-11 00:26:16 CDT unchanged (2bf26434b3292dff8d74639df6d2dabe)
2024-09-13 07:32:04 CDT unchanged (ef7deb524a292be0b01e8c3aa3ec4353)
2024-09-15 19:44:44 CDT unchanged (3a9498714b1625e3c8e6fd1b7c7b4ab7)
2024-09-20 06:12:31 CDT unchanged (e2a451293cd1b0446bd7b335b60e35ba)
2024-09-24 14:54:33 CDT unchanged (fb7c1a710301fd2a632d11c265acac1c)
2024-10-02 20:59:16 CDT unchanged (6b6fe7741cec4bc4f0745ef5caa89f17)
2024-10-07 22:44:25 CDT unchanged (d8115f53a1c7eec662b85703eeddbeb1)
2024-10-07 23:29:26 CDT unchanged (46bd29366fa808620ef04f7c5ff43a2e)
Processing snapshot User@desktop-kh0mk6g:S:\Archive
2024-08-17 00:35:37 CDT unchanged (5c9e09045ca6c8ad6d8b4955ac222e10)
2024-08-22 13:27:35 CDT unchanged (0c3eabf74a31b5ce14231c5db5b5d45f)
2024-08-28 23:08:20 CDT unchanged (06bb9399c06ba961741d9bac51ba6af0)
2024-09-10 16:12:28 CDT unchanged (5ae515d6de4a9e99541fe4c67f1f9906)
2024-09-13 09:00:27 CDT unchanged (4e19a769a05f27bc1505b74e67a8d2b5)
2024-09-13 11:31:03 CDT unchanged (44a8713285f371b3e15fc7dbb76f916f)
2024-09-24 18:25:50 CDT unchanged (aec9bf8fa6862caf0b99e442e4bdf75c)
2024-09-24 19:10:52 CDT unchanged (27589e8d9405d3336d954976d9e6dbbe)
Fixed 10 snapshots, but snapshot manifests were not updated. Pass --commit to update snapshots.

After a fix, then a full maintenance…I now have another error.

unexpected content error: invalid checksum at p9c2f2fb63170c3df74bff25b52ade7a7-sadf36634d393826012b offset 32 length 41730/41730: decrypt: unable to decrypt content: cipher: message authentication failed

I’m beginning to wonder if these are just intermittent bad reads from the repository which kopia interprets as a complete failure. When in reality, windows runs accross bad reads all the time, dealing with them by simply reading again and marking the block for replacement. The OS itself performs this defect mangement. The built in SMART defect management on most disks seems to be crippled to prevent excessive returns.

Accordingly, I would certainly like some way to set the number of seek retries before Kopia gives up? Because it does seem to me that Kopia in real life is unusable.

Also need a checkbox for “logging all errors” then continue. Kopia as currently constituted just stops,