This repository has been archived on 2021-11-15. You can view files and clone it, but cannot push or open issues or pull requests.
restic/templates/backup-to-restic.j2

22 lines
579 B
Django/Jinja

#!/bin/bash
export RESTIC_REPOSITORY=sftp:borg@10.7.89.117:restic
export RESTIC_PASSWORD={{ restic_password }}
if [ $(hostname) == management ]
then
restic backup /home/andreas --exclude-file=/home/andreas/.config/restic/excludes.txt
fi
if [ $(hostname) == {{ ansible_facts['hostname'] }} ]
then
cd {{ docker_project_path }}
sudo docker-compose pause
sudo -E restic backup /home/ansible --exclude-file=/home/ansible/.config/restic/excludes.txt
fi
if [[ -x /usr/local/bin/docker-compose || -x /usr/bin/docker-compose ]]
then
sudo docker-compose unpause
fi