|
@@ -0,0 +1,25 @@
|
|
|
|
+#!/bin/bash
|
|
|
|
+# {{ ansible_managed }}
|
|
|
|
+
|
|
|
|
+{% if backups is defined and 'containers' in backups %}
|
|
|
|
+{% if containers is defined %}
|
|
|
|
+{% for container in containers %}
|
|
|
|
+{% if container.volumes is defined %}
|
|
|
|
+{% for volume in container.volumes %}
|
|
|
|
+{% if backups_ignore not in volume|regex_replace(':.*') %}
|
|
|
|
+
|
|
|
|
+BACKUP_DIR='/opt/restores{{ volume | regex_replace(':.*') }}'
|
|
|
|
+
|
|
|
|
+echo "Starting restore of '{{ container.name }}:{{ volume | regex_replace(':.*') }} to $BACKUP_DIR'..."
|
|
|
|
+/usr/bin/rclone copy b2-container-data:current/{{ ansible_hostname }}/{{ container.name }}/{{ volume | regex_replace(':.*') | basename }} "$BACKUP_DIR" \
|
|
|
|
+ --fast-list \
|
|
|
|
+ --progress
|
|
|
|
+echo
|
|
|
|
+echo
|
|
|
|
+
|
|
|
|
+{% endif %}
|
|
|
|
+{% endfor %}
|
|
|
|
+{% endif %}
|
|
|
|
+{% endfor %}
|
|
|
|
+{% endif %}
|
|
|
|
+{% endif %}
|