We also have a script which logs in via SSH each night and copies the backup from the previous night over to DigitalOcean Spaces. In case there is a hardware failure on the server, this is our offsite backup to restore from.
As a third copy, we recommend that you take an occasional manual backup and save to your PC, or use this rsync guide to keep updated UniFi backup copies on your own server.
1. Get SSH access to your HostiFi server
The first step is to get SSH access as the unifi user to your HostiFi server by following this guide: https://support.hostifi.net/en/articles/3437198-how-to-ssh-or-sftp-into-your-unifi-server
2. Install rsync on your server
Rsync must be installed on both your server and the HostiFi server for it to work. We’ve already installed it for you on the HostiFi side.
You may need to look up instructions for installing rsync that are specific to the operating system you are using.
apt-get install rsync -y
3. Sync the UniFi backup directory at HostiFi to your server directory
Change x.hostifi.net to your server name, and /root to the directory on your server where you would like the backups to sync to:
rsync -avzh [email protected]:/var/lib/unifi/backup /root/unifi
4. Create a cronjob to run the rsync once per day
0 2 * * * rsync -avzh [email protected]:/var/lib/unifi/backup /root/unifi/
Optionally, you can add the –delete parameter in front of rsync to delete the older backups as UniFi does, reducing storage on your server.