Battle of the backup tools

· by Raghu Rajagopalan · Read in about 3 min · (582 words) ·

I’ve finally set up backup of the different servers at home and in a way that I’m actually satisfied. In the past, it had been just rsync scripts.. needless to say, that it wasn’t working out that well and so things stood. and so things stood.

alt

Last week, I was thinking of giving Gnome a try out - I prefer KDE and run KDE Neon user edition on my main machine. Unfortunately, I didn’t do my research before getting an NVidia 1050TI and now I have to deal with hangups and garbled SDDM screen once in a while on resume from standby. Anyway, I thought I’d give Gnome a try and was thinking of just installing on the root partition. While /home is on a different partition - so it’s pretty safe, it did get me thinking about my backups.

Had remembered reading about Borg on reddit and decided to look it up. While it felt like a vast improvement over rsync had a little trouble with the exclude filters. Also, that it’s python and C codebase and doesn’t run on windows was a (minor) issue. Looking for alternatives, came across restic. The UX for both is almost identical - with minor syntactical differences. So took a largish folder and tried both of them out. I finally did settle on Borg - but I’ll come to that later. First, what I liked and didn’t like with each:

What’s similar
  1. Deduping

  2. Chunked

  3. Fast run times.

  4. Backups can be mounted as disks for easy exploration/restoration

  5. Encrypted

  6. Github project stats on Stars, Forks and Watching are almost similar.

  7. Both are fast - first runs take some times but the deduping works really well.

Borg - What I liked
  1. Great documentation - see http://borgbackup.readthedocs.io/en/stable/installation.html

  2. Compression

Restic - What I liked
  1. Go - single binary

  2. Works on windows too.

  3. Cloud backends supported.

Where they differ

  1. Borg - Linux only. Restic is Go - so Windows is good. +0.5 restic

  2. Borg backup leaves some files out of the backup repository. With Restic the repo is self contained +1 restic.

  3. Borg - No cloud backup. Restic offers all three (Google, AWS and Azure ) - +1 Restic

  4. With Borg, Remote backup can’t be dumb - basically needs borg running on the server where as with Restic, the backup can rely on dumb storage - +1 Restic

And so I was almost decided on using restic but then realized that there’s no compression with Restic. Comparing backup repo sizes, Restic was weighing in at 5Gigs whereas Borg came in at a svelte 2.2 Gigs. Considering that backups have to be uploaded and downloaded, I decided to go with Borg for now (at least till restic implements compression)

For uploading borg back up repo to the cloud I’m currently using rclone - which is advertised as "rsync for the cloud".

I have my backup script set up to run daily with anacron and it’s been working well for the past week.

#! /bin/bash
export BORG_PASSPHRASE='something super secret!!!'
USER=raghu
BORGREPO=/data/borg-backup
BORGIGNORE=/home/$USER/.borgignore
PUSH=push.sh
RCLONE="rclone --config /home/$USER/.config/rclone/rclone.conf"

# take a backup of installed packages
apt-mark showmanual > /home/$USER/packages

borg create -s  --exclude-from $BORGIGNORE \
         $BORGREPO::"$(date --rfc-3339=s)" \
         /etc /home
if [[ $? -eq 0 ]]; then
    $PUSH  "Daily backup completed"
else
    $PUSH  "Daily backup failed"
fi
borg prune                          \
    --list                          \
    --show-rc                       \
    --keep-daily    7               \
    --keep-weekly   4               \
    --keep-monthly  6               \
$RCLONE  sync $BORGREPO azure-borg:home-desktop
if [[ $? -eq 0 ]]; then
    $PUSH  "Backup uploaded to azure"
else
    $PUSH  "Backup sync failed"
fi