Intterupted Rclone Sync of Restic to Remote B2

Consider this situation:

  • I backup my machine completely to a remote rest-server repository
  • I then rclone this repository to b2 (so that I have a local + remote copy of this)
  • I run another backup a few days later to the same local rest-server repository
  • I start another rclone, but it is interrupted half way through

Is the partially synced b2 copy viable in any way? Given the encryption key doesn’t change, will restic attempt to work with/heal any problems? Will I be at least capable of recovering all previous snapshots (prior to the interrupted one)? I presume so, given that restic doesn’t change old data - but, just wanted to be sure :slight_smile:

Yes, you will be able to restore the snapshot made in the first step of your list. The second snapshot will probably not be restorable, since not all data has been copied. It may happen that you don’t even see the snapshot yet (maybe the interruption occurs before the files in snapshots/ are synced). So the first snapshot is complete, the second one may not be.

When the situation happens as you described, the second repo on B2 will contain just a bit of additional data that is not referenced, or a snapshot with data missing. Running restic prune on the second repo directly will resolve most of it, but cannot pull the missing data out of thin air.

When you happen to run another backup against the same repo on B2, and the data is still available locally, it’ll be saved in the repo and the broken snapshot will “heal” itself. But that depends on whether or not the data is still available.

I can understand what your use case is, but I advise people to only sync in one direction (e.g. local → B2) and not sometimes use the local and sometimes the B2 repo for backup. I’m pretty sure it’ll work most of the time, but I haven’t tested that.

All in all I’d like to add that the repo format is pretty robust, which surprised me a lot. :slight_smile:

2 Likes

Wonderful - thanks for the confirmation - good to know it works the way I expected it would :slight_smile:

Haha, I would be extremely impressed and a little scared if it could :wink:

Thanks for adding this extra bit - whilst this is only a one way sync, I had considered at times running a backup direct to B2 whilst out and about, and then pulling down to my ITX box when. However, I hadn’t yet done that - and probably won’t, now (except, maybe, for testing). Thanks for your reply!