catch non local repos in export
This commit is contained in:
parent
dbb78ed37f
commit
90f6b0a360
1 changed files with 10 additions and 7 deletions
|
|
@ -4,14 +4,17 @@ set -euo pipefail
|
||||||
echo "Starting to export backups..."
|
echo "Starting to export backups..."
|
||||||
|
|
||||||
{% if backup_backend == 'restic' %}
|
{% if backup_backend == 'restic' %}
|
||||||
# restic backend
|
# restic backend
|
||||||
source /etc/backup-client/restic.env
|
source /etc/backup-client/restic.env
|
||||||
|
|
||||||
{% for i in backups.export.destinations if i.type == "rsync" %}
|
|
||||||
echo "exporting to {{ i.host }}"
|
|
||||||
rsync -h -r -a --append-verify --delete --stats -e "ssh -p {{ i.port|d(22) }} -i {{ i.key|d('/etc/backup-client/id_ed25519') }}" "${RESTIC_REPOSITORY}/" "{{ i.user }}@{{ i.host }}:{{ i.remotepath }}"
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
|
{% if backups.backends.restic.repo_type == "local" %}
|
||||||
|
{% for i in backups.export.destinations if i.type == "rsync" %}
|
||||||
|
echo "exporting to {{ i.host }}"
|
||||||
|
rsync -h -r -a --append-verify --delete --stats -e "ssh -p {{ i.port|d(22) }} -i {{ i.key|d('/etc/backup-client/id_ed25519') }}" "${RESTIC_REPOSITORY}/" "{{ i.user }}@{{ i.host }}:{{ i.remotepath }}"
|
||||||
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
echo "Repo is not local. Skipped."
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if not backup_backend %}
|
{% if not backup_backend %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue