Compare commits

...

2 Commits

3 changed files with 55 additions and 41 deletions

View File

@ -1,12 +1,12 @@
## The playbook first runs the 'backup.yml' from each role ## The playbook first runs the 'backup.yml' from each role
- name: create the /backup-dirs file - name: create the /backup-dirs file # this also runs on main in case someone doesn't run the backup.yml
file: file:
path: "/backup-dirs" path: "/backup-dirs"
state: "touch" state: "touch"
mode: "0400" mode: "0400"
changed_when: "true" # we always want ti give roles a chance to register dirs changed_when: "true" # we always want ti give roles a chance to register dirs
- name: Ensure file contains lines from array - name: Ensure file contains lines from array # this also runs on main in case someone doesn't run the backup.yml
lineinfile: lineinfile:
path: /backup-dirs path: /backup-dirs
line: "{{ item }}" line: "{{ item }}"

View File

@ -1,5 +1,17 @@
- debug: - name: create the /backup-dirs file # this also runs on main in case someone doesn't run the backup.yml
var: group_names file:
path: "/backup-dirs"
state: "touch"
mode: "0400"
changed_when: "true" # we always want ti give roles a chance to register dirs
- name: Ensure file contains lines from array # this also runs on main in case someone doesn't run the backup.yml
lineinfile:
path: /backup-dirs
line: "{{ item }}"
create: yes
state: present
loop: "{{ extra_backup_paths }}"
- name: make sure restic is installed - name: make sure restic is installed
apt: state=latest pkg=restic apt: state=latest pkg=restic

View File

@ -5,6 +5,7 @@ original_dir=$(pwd)
source ./vars.sh source ./vars.sh
cd "$original_dir" cd "$original_dir"
(
./mount.sh & ./mount.sh &
RESTIC_PID=$! RESTIC_PID=$!
@ -53,3 +54,4 @@ kill -SIGINT $RESTIC_PID
umount /mnt/restic umount /mnt/restic
echo "DONE" echo "DONE"
) >"/var/log/backup-restore-$(date +%s).log"