Setup backup server configuration for backup replication.
This commit is contained in:
1 parent
768da9cf45
commit
6ddfb8409c
9 files changed
+240
-12
No files matched your search
@@ -0,0 +1,7 @@
|
||||
{% for client in backup_clients %}
|
||||
Host {{ client }}
|
||||
HostName {{ backup_host }}
|
||||
Port {{ backup_ssh_port }}
|
||||
User {{ backup_clients[client].owner }}
|
||||
IdentityFile {{ backup_home }}/.ssh/{{ client }}
|
||||
{% endfor %}
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
BORGUSER="{{ backup_owner }}";
|
||||
RUNFOLDER="{{ backup_storage }}";
|
||||
APPLIST="{{ backup_clients | json_query('*.app') | join(' ') }}"
|
||||
|
||||
declare -A BORG_REPOSITORY_MAP
|
||||
{% for client in backup_clients %}
|
||||
BORG_REPOSITORY_MAP[{{ backup_clients[client].app }}]="{{ client }}"
|
||||
{% endfor %}
|
||||
|
||||
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="ssh://'$REPOLOCATION':./'$APP'";
|
||||
borg list $REPOLOCATION'
|
||||
done
|
||||
Reference in new issue
Block a user