2023-06-25 01:38:24 +02:00
|
|
|
# borgmatic quickguide
|
|
|
|
|
2023-06-25 01:59:40 +02:00
|
|
|
1. `ssh-keygen` # without passphrase
|
2023-06-25 01:59:15 +02:00
|
|
|
2. `echo 'command="borg serve --restrict-to-repository /home/borgbackup/repos/FQDN",restrict ' $(cat ~/.ssh/id_rsa.pub) |ssh borgbackup@BACKUPHOST -c "cat - >> ~/.ssh/authorized_keys"`
|
|
|
|
3. `borg init -e repokey borgbackup@BACKUPHOST:repos/FQDN` # you have to enter a PASSPHRASE (`pwgen 24 1`)
|
|
|
|
4. `mkdir -p /etc/borgmatic/`
|
2023-06-25 01:53:48 +02:00
|
|
|
5. /etc/borgmatic/config.yml
|
2023-06-25 01:38:24 +02:00
|
|
|
```
|
|
|
|
location:
|
|
|
|
source_directories:
|
|
|
|
- /etc/
|
2023-06-25 01:39:24 +02:00
|
|
|
- /home/
|
2023-06-25 01:38:24 +02:00
|
|
|
repositories:
|
2023-06-25 01:53:48 +02:00
|
|
|
- borgbackup@BACKUPHOST:repos/FQDN
|
2023-06-25 01:38:24 +02:00
|
|
|
storage:
|
|
|
|
encryption_passphrase: PASSPHRASE
|
|
|
|
retention:
|
|
|
|
keep_daily: 7
|
|
|
|
keep_weekly: 4
|
|
|
|
keep_monthly: 6
|
|
|
|
keep_yearly: 1
|
|
|
|
|
2023-06-25 01:53:48 +02:00
|
|
|
```
|
|
|
|
6. /etc/cron.daily/borgmatic
|
|
|
|
```
|
|
|
|
#!/bin/sh
|
|
|
|
borgmatic
|
|
|
|
```
|
2023-06-25 01:59:15 +02:00
|
|
|
7. `chmod +x /etc/cron.daily/borgmatic`
|
2023-06-25 01:58:26 +02:00
|
|
|
8. `BACKUPHOST:~$ borg list --format '{archive}{NL}' repos/FQDN` # list backups from backupserver
|