Hero Image

Backing up my hosted providers' virtual machines with qemu

This post is mostly about the various ways I had thought about how to automatically backup remote servers. I had bought an hc4 dock from harkernel, and had two 4tb disks hanging around. I installed armbian on it, and got myself a appliance timer since I needed to not run the thing all the time.

The basic setup is to:

install mdadm with raid1

install rsync

setup ssh keys and user (remote) you do need to do passwordless keys, which is the reason that I give my 'backup' user (who doesn't login as root, of course!) only RO to the necessary files (change perms accordingly with chgrp -R groupname file/)

install signal-cli-send (from a previous post)

create a new script in /etc/cron.daily/backup

modify the /etc/crontab to change /etc/cron.daily to a time which is AFTER the time I set the timer to turn things on).

Set the timer to turn on at 01:50 am (it doesn't do 24 hours alas), and to turn 'off' at 23:50:00.

the nice little trick is the 'poweroff' at the end, which turns of the device until the egg timer turns on the power.

Once this is done, the system quite nicely backs up my stuff automatically, and no unnecessary power consumed, since it only turns on when its needed.