Skip to content
Snippets Groups Projects
Verified Commit 90f6b0a3 authored by nd's avatar nd
Browse files

catch non local repos in export

parent dbb78ed3
No related branches found
No related tags found
No related merge requests found
...@@ -7,11 +7,14 @@ echo "Starting to export backups..." ...@@ -7,11 +7,14 @@ echo "Starting to export backups..."
# restic backend # restic backend
source /etc/backup-client/restic.env source /etc/backup-client/restic.env
{% if backups.backends.restic.repo_type == "local" %}
{% for i in backups.export.destinations if i.type == "rsync" %} {% for i in backups.export.destinations if i.type == "rsync" %}
echo "exporting to {{ i.host }}" 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 }}" 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 %} {% endfor %}
{% else %}
echo "Repo is not local. Skipped."
{% endif %}
{% endif %} {% endif %}
{% if not backup_backend %} {% if not backup_backend %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment