My main PC workstation (as opposed to my Mac Pro) is a dual-boot Windows and Linux machine. While backing up the Windows portion is relatively easy via some cheap-ish commercial backup software, I ended up backing up my Linux home directories only very occasionally. Clearly, Something Had To Be Done ™.
I had a look around for Linux backup software. I was familiar with was Timeshift, but at least the Manjaro port can’t back up to a remote machine and was useless as a result. I eventually settled on rdiff-backup as it seemed to be simple, has been around for a while and also looks very cron-friendly. So far, so good.
The main snag I ran into was that rdiff-backup is trying to start its server portion on the destination server via ssh and, well, I didn’t have rdiff-backup installed on my FreeBSD server. My first attempt at using the port did not go well – I suspect this is because the port is out of date. Manjaro provides rdiff-backup 2.0, whereas the FreeBSD port is sitting at 1.2.8. Either way I couldn’t get the two to talk so I ended up uninstalling the port again and installing rdiff-backup on FreeBSD 12.1 using pip.
Assuming you have pip installed – which I didn’t, but it’s also available as a port – the overall installation is relatively simple:
- Install librsync, which is the main dependency for rdiff-backup
- Do a per-user install of rdiff-backup. As I also had to tell the build script where it would find librsync, the command line looked something like this:
env CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib pip install --user rdiff-backup
The CFLAGS/LDFLAGS incantation is necessary as the /usr/local paths weren’t in the standard include paths on my setup.
- Update the path setting in your remote shell so it picks up the bin directory that the pip user install ended up in – in my case, I had to add $HOME/.local/bin to the path for the default shell. As I use tcsh as my default shell, I needed update the path setting in my .cshrc to include this directory.
Once I went through the changes above and verified that I could manually run
ssh -C rdiff-backup --help and got an error message that the –help parameter wasn’t supported.
That’s all it took to get rdiff-backup talking between my Manjaro Linux workstation and the FreeBSD 12.1 home server.