Offsite Backup Config

This commit is contained in:
2022-07-04 02:10:02 +02:00
parent 33995124d8
commit 06a014f39c
4 changed files with 151 additions and 106 deletions

View File

@ -1,17 +1,18 @@
#!/bin/sh
# Setting this, so the repo does not need to be given on the commandline:
export BORG_REPO=~borgbackup/backup
PUSH_KEY={{ backup.pushkey }}
# See the section "Passphrase notes" for more infos.
#export BORG_PASSPHRASE='XYZl0ngandsecurepa_55_phrasea&&123'
export BORG_PASSPHRASE='{{ backup.password }}'
export BORG_REPO=ssh://{{ backup.remote.user }}@{{ backup.remote.url }}
export BORG_RSH='ssh -i /root/.ssh/storagebox'
# some helpers and error handling:
info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; }
trap 'echo $( date ) Backup interrupted >&2; exit 2' INT TERM
info "Initialize Repo"
borg init -e none
borg init -e repokey
info "Starting backup"
@ -48,8 +49,6 @@ borg prune \
--keep-weekly 4 \
--keep-monthly 6 \
chown -R borgbackup ~borgbackup
prune_exit=$?
# use highest exit code as global exit code

1
templates/storagebox.j2 Normal file
View File

@ -0,0 +1 @@
{{ backup.remote.keyfile }}