Setting-up a Remote Backup Rsync Server

Tish continues to tell me we need an off-site backup solution for a large portion of the data we hold on the NAS. She's probably not wrong! So I've recently been thinking about how to do this. I've decided to go down the Rasp Pi (RPi) route, using Rsync probably secured over SSH2. The physical device is going to be living off-site (at a parents house I expect) and so needs some extra tweaks.

First-off are likely to be integration with dynamic DNS, uPNP and possibly local DNS. For dynamic DNS I expect I'll simply end up using ddclient

sudo apt-get install ddclient

For the uPnP IGD (Internet Gateway Device) access I will probably need something like miniupnpc to poke holes in the firewall

sudo apt-get install miniupnpc

Followed by something like

upnpc -r PORT tcp

to redirect PORT to the local machine. With the setup above the RPi will configure the local network system to forward the correct port to the RPi.

With SSH forwarded to the pi it then appears that a simple rsync command will be sufficent

rsync -avz -e 'ssh -i SSH_KEY' SRC user@remotehost:DEST/