1
0
Fork 0

Restic : add local copy script, change binary

TODO : Change backup script to use environment variables is set, like local copy
Local copy script assumes repository already exists. TODO ? Make it create if needed, handle prunes
This commit is contained in:
trotFunky 2021-03-14 21:04:54 +00:00
parent bb10cbee0d
commit cd7ffa12e4
2 changed files with 21 additions and 1 deletions

View file

@ -1,7 +1,8 @@
#!/bin/bash
# Use setcap'd binary in home directory
PATH="/home/restic/bin/:$PATH"
#PATH="/home/restic/bin/:$PATH"
# Now uses binary in /usr/bin, which is also setcap'd
backup_origin="/backups/restic"
backup_container="central-backup"

19
VPS/restic-local-copy.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/bash
set -euo pipefail
backup_origin=${backup_origin:-"/backups/restic/"}
backup_container=${backup_container:-"central-backup"}
local_repository="$backup_container""-local"
cd "$backup_origin"
source openrc.sh
export RESTIC_PASSWORD_FILE="$backup_container".pass
export RESTIC_PASSWORD_FILE2="$local_repository".pass
export RESTIC_REPOSITORY="swift:$backup_container:/restic"
export RESTIC_REPOSITORY2="$backup_origin""$local_repository"
# Higher connection count seems to help greatly with copy time
restic copy -o swift.connections=100 -vv