init
This commit is contained in:
commit
883f31932e
169 changed files with 5676 additions and 0 deletions
10
ansible/roles/docker/templates/backup-docker-volumes.sh.j2
Normal file
10
ansible/roles/docker/templates/backup-docker-volumes.sh.j2
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
BACKUP_DIR="{{ backup_staging_dir | default('/var/backups') }}/{{ backup_name }}"
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
{% for vol in backup_volumes | default([]) %}
|
||||
docker run --rm -v {{ vol }}:/data:ro -v "$BACKUP_DIR":/backup alpine sh -c "tar czf /backup/{{ vol }}.tar.gz -C /data . || [ \$? -eq 1 ]"
|
||||
{% endfor %}
|
||||
{% for f in backup_files | default([]) %}
|
||||
cp "{{ f }}" "$BACKUP_DIR/"
|
||||
{% endfor %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue