I am a bit panicked because my backup failed yesterday and I am not sure why. Please bear with me, I am only beginning to get into Unix and a more terminal-centric usage of my computer.
I am on EndeavourOS running restic 0.12.1-2 from the Arch community repo.
I have a directory (size ~1.5 TB) which I have already successfully backed up to an external HDD with restic. Now I wanted to back up said directory to an online provider as well. I chose Wasabi and followed the instructions in the restic documentation. I created a little script and then left my computer (was gone for a week since I expected it to take some time) to do the backup.
# Init repository - Not needed anymore!
#restic -r s3:https://s3.eu-central-1.wasabisys.com/<...> init
# Create new snapshot
echo 'INFO: Creating new snapshot!'
restic -r s3:https://s3.eu-central-1.wasabisys.com/<...> backup ~/work
if [ $retVal -ne 0 ]; then
echo 'INFO: Done!'
echo 'Hibernating in 10s...'
Unfortunately, I have not saved the terminal output. But I remember that there were several “ConnWaitError” errors and restic finished with exit code 1.
So I have several questions:
Just a quick sanity check, no data on my drive was modified by restic. Only a snapshot was written to the wasabi bucket but that snapshot failed?
Has anyone else experienced such an error? Did not find anything, except this lorentzkim Profile - gitmemory , leads me to believe this is an error that is not on my end.
Is there anything I can do to avoid this error? Can I improve my script or how should I go from here?
Is this a statement or really a question? If you see a new restic snapshot over at Wasabi, then the backup completed. It would be good to see the output from the backup, but since you don’t have that we can only presume that the backup did complete. It might just be that there were some unreadable files during the backup process, and some connectivity issues as well.
This doesn’t have to mean there was a big problem, it’s more important to look at what the end result was, so I wouldn’t worry too much about it.
Restic should finish with exit code 1 if there was a fatal error preventing a snapshot to be saved in the end. But since you say that you have a snapshot, I’m asking, is it possible that restic exited with exit code 3 (rather than 1)? What makes you think/say that the exit code was 1?
I never used Wasabi myself so I can’t comment on the other questions. But what I’d do in your place now is to simply verify the integrity of the repository. You can either run the check command which verifies that the structure of the repository is intact, or you can run the check --read-data command+option which will do the aforementioned but also verify that all the data in your repository is intact. If you do the latter, you can rest assured that everything is fine.
Another thing you can do, but this won’t verify the integrity of the data, is to simply to another backup run. Restic will then report how much new data it added to the repository (which assuming that the previous/initial backup completed should be about as much as you changed since then), as well as let you know if there’s any files it cannot read during the process.
Since it won’t hurt to run the backup again, and it’s likely that it will only add a little data (assuming you haven’t changed much since last snapshot), this should be fine to try before the check I guess
My questions were probably worded confusingly. Restic did finish with exit code 1, that was printed out by my script. I also can not see any snapshots in the repository right now. What I wanted to know was whether or not I put something wrong in the script (which I do not believe…just as a sanity check).
Okay, so I understand that after an aborted backup I can just run another backup again and restic will sort things out by itself, correct? I was worried that the repository might have some bad data in it or something like that.
Then I will just start another run and run the check command after.
Very much so. You explicitly wrote “a snapshot was written to the wasabi bucket”, and now you say that is not what you meant. That’s not exactly helping us spend time writing the right replies, quite the opposite.