Since getting Gitea running on my Pi, I realize that for the first time there's some data gravity there. If that machine gets clobbered, I'll lose not just caches of works in progress, but some actual data. Not very much data, and as it happens mostly data that's already in some other places already; but something, and quite reasonably in the future something more.
That can mean only one thing, backups.
I'm currently using Backblaze to back up my MacBook Air, so I have an account and I'm already familiar with the system (and happy to pay them a few dollars for services). The hunt for backup software landed on Restic. The Pi 4 has 8GB of memory, an SSD, and it's on a gigabit internet link, so there's some hope that if everything goes well that it won't take very long to grab a first snapshot. Here's how it went.
I followed the instructions at How to configure Backblaze B2 with Restic on Linux and they worked right out of the box. To simplify repeatable operations I put the command invocations into shell scripts.
The first backup completed in about 15 minutes, and it dumped about 4 GB of data and over 200,000 files. Most of those files were caches from Chromium, so completely unnecessary to preserve. The second backup on the same data set with no changes took about 2 minutes to complete, since Restic knows about duplicated data and doesn't send it twice. The third, with some exclusions of caches, was only 90,000 files. I think I can get the file count down further by omitting more caches.
One thing that didn't get preserved correctly yet is my Gitea in Docker setup, as I have some data in files there with a MariaDB database that I will want to dump out.
The best test of backups is whether you can restore them. The Restic restore instructions are going to be useful; I haven't tried to use them just yet, but this project is not complete until I have that sorted out.
A note shared by kemonine who uses these tools recommends
being careful with restic prune
, since it takes up a whole
lot of memory and CPU in order to repack and shrink the
archives. There's work underway to
speed up prune in Restic
in PR 2718. As you might expect getting this correct and tested
is going to take some time, but I'm encouraged by that progress.
Comments
You can follow this conversation by subscribing to the comment feed for this post.