← all posts site ↗

simplifying server backups straight to b2

my backup setup had been growing unchecked for months — restic snapshots piling up on a local drive and also being pushed to backblaze b2. i thought i was being clever with redundancy but really i was just burning local disk space for no reason. if the server itself dies, the local restic repo dies with it, so what's the point of keeping a second copy on the same machine? the whole point of offsite backup is surviving a hardware failure or a fire or whatever. local repos just give you faster restores for file-level accidents, which i realized i never actually use that way anyway.

so i ripped out the local restic repos entirely. everything now goes straight to b2 with a single restic profile configured to use b2's native lifecycle rules for retention instead of restic's own forget policies — that way the snapshot pruning happens server-side and i don't have to worry about running forget commands on a cron that might fail silently. switched to a daily incremental with a weekly full check using restic's check command against the b2 bucket. also added a pre-backup hook that dumps all the databases (postgres, sqlite files that are in active use) into a temp dir so restic gets consistent copies instead of hot files that might be mid-write.

the real win was the glance dashboard widget. i built a small custom card that hits the b2 api to show the bucket size, the number of snapshots, the date of the last successful backup and the last check run. it also pulls the b2 billing data to show what i'm spending on storage class A and class B transactions — which is absurdly cheap, like less than a dollar a month for a few hundred gigs of docker volumes and media configs. the widget sits right next to my uptime cards and system health graphs so i can see at a glance whether backups ran overnight without having to ssh in and run restic stats manually. honestly the best part of this whole cleanup is not thinking about backups anymore. they just happen, i can see they happened, and i don't have a second copy of all my crap eating local storage for no benefit.