catch non local repos in export

This commit is contained in:
nd 2021-06-06 01:48:48 +02:00
parent dbb78ed37f
commit 90f6b0a360
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9

View file

@ -7,11 +7,14 @@ echo "Starting to export backups..."
# restic backend
source /etc/backup-client/restic.env
{% 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 %}
{% if not backup_backend %}