NTNP

Building a Backup Server

Home Lab

I’ve been backing my NAS up to B2 for a while. But I didn’t like how it was handling it. So, I built my own backup server.

One Is None


My NAS is a Synology DS418. An older NAS, but still gets the job done. It has a program built in called cloud sync. It does just that, syncs part of the NAS, to the cloud. That’s what I’ve been using to back things (like photos and VM disk images) up to B2. There’s just a couple things I don’t like about it.

The main one, is that it can be slow. The first backup I did of my photos took over two days. Way longer than it should have. The more important one, I don’t like how it does encryption.

The idea, of locking my data behind a tool, that only runs on the brand of box that that made the tool, doesn’t sit well with me. Any of my systems, should have the ability to decrypt my backed up data, if I want them to. I want the NAS, to just be a storage box, and do nothing else. Another system can do the backup.

So I fired up a VM on the cluster, and got to work.

Cloning


The tool I’m using, is rclone. It supports pretty much every cloud provider, and will run on almost everything. Including FreeBSD, my preferred server OS. This seems pretty simple… Until I ran into an issue.

The first thing I thought would be an issue, was if a backup didn’t finish, before cron fired off another identical backup job. Turns out, that was a non issue. All I had to do was use the built in lockf command.

The issue I actually had, was running out of RAM, and swap. I just went full hog on fixing that. Bumping the RAM to 16GB, and adding a second 32GB swap drive.

The extra RAM and swap did the trick.

How Is It?


After letting it do its thing for a few days. Pretty well. It backs things up, it encrypts them, and I can decrypt the data from other computers.

This was also the last thing I was using software on the Synology to handle. Moving this task off of it, makes the NAS interchangeable with something from a different brand1, as all it does now, is store shit.

So yeah, I’m pretty happy with this.


  1. Something I am looking at doing. ↩︎


Reply via email