Setup backup server configuration for backup replication.

This commit is contained in:
lhahn committed 2024-08-11 22:26:49 +02:00
1 parent 768da9cf45
commit d1f10472da
9 files changed
+237 -11

No files matched your search

@@ -0,0 +1,18 @@
#!/bin/bash
APPLIST="{{ backup_clients.keys() | join(' ') }}"
declare -A BORG_REPOSITORY_MAP
{% for client in backup_clients %}
BORG_REPOSITORY_MAP[{{ backup_clients[client].app }}]="{{ client }}"
{% endor %}
for APP in $APPLIST;
do
REPOLOCATION=${BORG_REPOSITORY_MAP[$APP]}
BORG_PASSPHRASE=$(cat {{ backup_key_folder }}/$APP)
sudo -H -u $BORGUSER bash -c '
BORG_PASSPHRASE='$BORG_PASSPHRASE';
REPOLOCATION="ss://'$REPOLOCATION':./'$APP'";
borg list ssh://$REPOLOCATION'
done