Backing up homelab resources
My homelab keeps a bit of everything: config files, personal data, Prometheus metrics… losing any of it would hurt, so I spent some time figuring out how to back it all up properly, and how to get notified when something goes wrong (because sooner or later it does!).
All my files live on a NAS with redundant drives, so a single disk dying is not a big deal. But redundancy is not a backup: if the NAS burns (!!!) or gets hit by ransomware (more likely maybe nowadays?), everything is gone. For disaster recovery I also want a copy in the cloud, following the well known 3-2-1 backup rule: 3 copies of your data, on 2 different types of media, with 1 copy off-site. So that’s why I use Rustic: it’s a great tool that allows me to backup the whole NAS (several TBs) into S3 Deep Glacier cold storage (which is really really cheap – I spend between 1$-2$ per month).
Problem: I couldn’t find any tool to run Rustic on a schedule the way I want (sometimes a backup can take many minutes with IO and network activity spiking – I want to know when backups start and when they stop, etc). I first created a bunch of Bash scripts – they did the job but not with the quality and observability I was aiming for. So I wrote rustic-scheduler to cover all those gaps. It also has an optional web interface, Telegram notifications (via Apprise), Prometheus support (for alerting in case backups fail, etc). If you have similar setup/needs, give it a try!
About backups: I use Prometheus a lot to keep very long history (years). Sometimes the ability to compare the behavior/trends of e.g. energy consumptions along many years is really useful! Problem: I couldn’t ifnd any tool to reliably backup Prometheus (!!!) which is really weird given how popular it is. So I wrote prometheus-snapshot-manager. It takes TSDB snapshots on a schedule, compresses them and uploads them to local, SFTP or S3-compatible storage, with retention and notifications as well.
Why write my own tools? Simply because I couldn’t find anything online that did what I needed. I’ve been running both for a few months now and I’m really happy with them.
Whatever tools you pick, two tips: keep a copy somewhere away from the original machine, and test your restores regularly. A backup is only useful if you can actually get your data back!
Comments, suggestions and bug reports are very welcome: just open an issue on rustic-scheduler or prometheus-snapshot-manager.