Backups for MacOS with borgbackup utility. Tested with borgbackup version 1.1.4
- Install docker on server
- Run container:
docker run -d -p 212:22 -v /opt/backupstorage:/storage --name borg-server -e BORG_AUTHORIZED_KEYS='YOUR_SSH_PUB_KEY' geri4/borgbackup-server:1.0.10
- Install borgbackup:
brew install borgbackup
- Initialyze repository, specify repo password and remember it:
borg init -e repokey ssh://borg@backupserver.com:212/storage/mymac
- Copy backup.sh from this script to your home directory and give it run permissions:
cp backup.sh ~/backup.sh && chmod a+x ~/backup.sh
-
Edit variables in ~/backup.sh. Set REPO_URL and REPO_PASSWORD. REPO_PASSWORD should be the same as in step 2. Also specify directories that you want to backup.
-
Open crontab editor:
crontab -e
- Add this line and save the crontab file:
*/15 * * * * ~/backup.sh &>/dev/null