I have played a bit w/ restic, and now I’m trying to write some scripts (node js) for automatic backup. The node.js script launches the
During this process, I hit quite often CTRL + C. I think that the
restic command catches CTRL + C and does a graceful shutdown. I’m not sure if this also happens when I CTRL + C on the parent node.js script.
Initially I had an error which was complaining about a bad snapshot. I saw that it existed as file in the repo, but had length = 0. So w/o doubt the result of the above flow. But I deleted it and things started to work.
restic check command says:
... check all packs pack 5e37e6f6: not referenced in any index 1 additional files were found in the repo, which likely contain duplicate data. You can run `restic prune` to correct this. check snapshots, trees and blobs error for tree [null]: id 0000000000000000000000000000000000000000000000000000000000000000 not found in repository Fatal: repository contains errors
restic prune which fails with an exception:
building new index for repo [0:00] 100.00% 4797 / 4797 packs incomplete pack file (will be removed): 5e37e6f67f2f8d048952ce3f6e84b8dd3ffdb2bac275eb06986d5c6ef33f5585 repository contains 4796 packs (571662 blobs) with 22.190 GiB processed 571662 blobs: 63 duplicate blobs, 16.186 MiB duplicate load all snapshots find data that is still in use for 13 snapshots [0:32] 92.31% 12 / 13 snapshots id 0000000000000000000000000000000000000000000000000000000000000000 not found in repository github.com/restic/restic/internal/repository.(*Repository).LoadBlob /restic/internal/repository/repository.go:156 github.com/restic/restic/internal/repository.(*Repository).LoadTree /restic/internal/repository/repository.go:723 github.com/restic/restic/internal/restic.FindUsedBlobs /restic/internal/restic/find.go:19 main.getUsedBlobs /restic/cmd/restic/cmd_prune.go:276 main.pruneRepository /restic/cmd/restic/cmd_prune.go:158 main.runPrune /restic/cmd/restic/cmd_prune.go:62 main.glob..func18 github.com/spf13/cobra.(*Command).execute /email@example.com/command.go:826 github.com/spf13/cobra.(*Command).ExecuteC /firstname.lastname@example.org/command.go:914 github.com/spf13/cobra.(*Command).Execute /email@example.com/command.go:864 main.main /restic/cmd/restic/main.go:98 runtime.main /usr/local/go/src/runtime/proc.go:204 runtime.goexit /usr/local/go/src/runtime/asm_amd64.s:1374
Thanks in advance for any hints!