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.
2021-11-15 16:50:19 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
export RESTIC_REPOSITORY=sftp:borg@10.7.89.117:restic
|
|
|
|
export RESTIC_PASSWORD={{ restic_password }}
|
|
|
|
|
|
|
|
if [ $(hostname) == management ]
|
|
|
|
then
|
2021-11-15 17:08:45 +01:00
|
|
|
restic backup /home/andreas --exclude-file=/etc/restic/excludes.txt
|
2021-11-15 16:50:19 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $(hostname) == {{ ansible_facts['hostname'] }} ]
|
|
|
|
then
|
2021-11-15 17:52:05 +01:00
|
|
|
cd {{ docker_project_path | default('/home/ansible') }}
|
2021-11-15 16:50:19 +01:00
|
|
|
sudo docker-compose pause
|
2021-11-15 17:08:45 +01:00
|
|
|
sudo -E restic backup /home/ansible --exclude-file=/etc/restic/excludes.txt
|
2021-11-15 16:50:19 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -x /usr/local/bin/docker-compose || -x /usr/bin/docker-compose ]]
|
|
|
|
then
|
|
|
|
sudo docker-compose unpause
|
|
|
|
fi
|