manaslupisani / macos-borgbackup

Script for macos to backup files using borgbackup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MacOS borgbackup script

Backups for MacOS with borgbackup utility. Tested with borgbackup version 1.1.4

Server side

  1. Install docker on server
  2. 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

Client(MacOS) side

  1. Install borgbackup:
brew install borgbackup
  1. Initialyze repository, specify repo password and remember it:
borg init -e repokey ssh://borg@backupserver.com:212/storage/mymac
  1. 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
  1. 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.

  2. Open crontab editor:

crontab -e
  1. Add this line and save the crontab file:
*/15 * * * *  ~/backup.sh &>/dev/null

About

Script for macos to backup files using borgbackup


Languages

Language:Shell 100.0%