Is there a return code of kopia snapshot verify if verification fails?

I want to run verification as background process and thought about doing something like

kopia snapshot verify --verify-files-percent=100 || notify-send --urgency=critical --icon=dialog-error --category=error --expire-time=0 "Backup Verification Failed" "An error was reported when verifying kopia backup"

I found `kopia snapshot verify` exits with status code 0 even when it didn't finish successfully · Issue #3605 · kopia/kopia · GitHub which could imply that normally there should be an error code.

2 Likes

Just bumping this, I also use verify, in cron to check the health of the repo.

1 Like

I am checking the return status like this my-kopia-docker/scheduler/run.sh at master · randombyte-developer/my-kopia-docker · GitHub on a daily run. I am checking it through docker exec but I guess it should be the same when executing it on the same machine.

I can confirm that it fails when there is a verification error. I have simulated this. Also it will fail when the container’s host ran out of storage space (due to large cache sizes of kopia and multiple instances). It will also fail when unplugging my local backup drive. And it will also fail when the remote backup service it unreachable.

1 Like