Borg is a backup program written in Python that has excellent deduplication functionality. For my blog server backups you can see just how much smaller the deduplicated repository size is.
If you run your websites on small servers like I do then this comes in handy to save some money. I currently have two layers of backups on my servers:
- Linode provides their "Linode Backup" system. This is a complete backup of the entire disk your server is running on for a reasonable price.
- Borg backup for daily automated backups that allow for quick "oops" restores.
These backups serve two different purposes. I can do an emergency full system restore using Linode, and a quick Borg restore if I happen to do something stupid, like accidently delete a blog post.
I currently use a slightly modified script in my /etc/periodic/daily
folder based on Borg's quick start automation suggestion.
Borg's documentation can explain this better than I can but the gist is:
- I run daily backups on all my unique server files in
/srv
and/etc
. I don't backup anything that is a system default. - Then prune my backups to only keep 7 daily, 4 weekly, and 6 monthly backups at any given time.
- Then we compact the repository to save space and exit.
A better option for storing Borg backups would be to set up a Borg repo on another server or a platform like BorgBase. BorgBase is nice since they will notify you by email if a backup doesn't happen or fails however, as I said before, I only use Borg for "oops" backups so if I were to miss a couple I wouldn't stress out about it.
As an extra to this post, I have on my servers a server-health-check.sh
script that allows me to quickly check things like auto-updates, Borg backups, free memory, and used disk space! I run it every so often just for peace of mind.
The output of this script is pretty well formatted without much effort and looks a little something like this:
If you're interested in Borg you can read more about it on Borg's website, they have extensive and well written documentation.