Igor Bubelov About Blog Photos

Backups and Restic

May 27, 2021

Backups are crucial, even if you rely on cloud storage solutions. Many people mistakenly believe that Dropbox or iCloud can never lose user data. It’s not true at all, those things happen all the time. If you have anything of value, you should back it up from time to time. Cloud is not enough, you should have a real physical copy, just in case something goes wrong.

I’ve tried many backup solutions and none of them worked well enough for my needs. Finally, I’ve found a decent backup tool: Restic. It’s fast, secure, it’s written in a decent language (Go), and it also supports cheap S3 cold storage.

My backup routine looks like this:

  1. A dedicated backup host launches a backup job once a day.
  2. Backup job pulls new data form every server containing valuable data via rsync.
  3. Then it adds those new changes to a Restic repository.
  4. After that, it sends those changes offsite via S3.

With such a setup, my data always exists in at least three places:

  1. On production servers.
  2. On backup host.
  3. Offsite.

Restic also encrypts the data before sending it offsite so there are no privacy issues with sending my backups to a data center. Having offsite copy is important, because things like fires and natural disasters can easily destroy all your copies if you keep them in a single physical location.