This repository was archived by the owner on Mar 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 8080 - " /opt/systemd-backup"
8181 - " /opt/crontab-backup"
8282
83+ # Backup config files
8384 - name : " Copy files to '{{ local.destination }}'"
8485 copy :
8586 src : " {{ item }}"
9798 - " /home/{{ user }}/.config/rclone/rclone.conf"
9899 ignore_errors : yes
99100
101+ # Backup the excludes list if it exists
100102 - name : " Look for 'backup_excludes_list.txt' file in cloudbox folder"
101103 stat :
102104 path : " {{ playbook_dir }}/backup_excludes_list.txt"
112114 force : yes
113115 when : (backup_excludes_list.stat.exists)
114116
117+ - name : Set 'backup_excludes_list_path' variable
118+ set_fact :
119+ backup_excludes_list_path : " {{
120+ (playbook_dir + '/backup_excludes_list.txt')
121+ if ((backup_excludes_list is defined) and (backup_excludes_list.stat.exists))
122+ else (playbook_dir + '/roles/backup/files/backup_excludes_list.txt') }}"
123+
115124 - name : Cloudbox Restore Service
116125 import_tasks : " restore_service.yml"
117126 when : restore_service_enabled
305314 --ignore-failed-read \
306315 --warning=no-file-changed \
307316 --warning=no-file-removed \
308- --exclude-from '{{ (backup_excludes_list is defined and backup_excludes_list.stat.exists) | ternary(playbook_dir + '/backup_excludes_list.txt', playbook_dir + '/roles/backup/files/backup_excludes_list.txt') }}' \
317+ --exclude-from '{{ backup_excludes_list_path }}' \
309318 -cf '{{ local.destination }}/opt/{{ item | basename }}.tar' -C '{{ item | dirname }}' './{{ item | basename }}' \
310319 2> /dev/null
311320 args :
Original file line number Diff line number Diff line change 88# GNU General Public License v3.0 #
99# ########################################################################
1010---
11- # Set basic variable(s)
11+ # Set 'user' variable
1212- name : " Get 'cloudbox.yml' info."
1313 stat :
1414 path : " {{ playbook_dir }}/backup.yml"
1515 register : backup_yml
1616
17- - name : Set variables
17+ - name : Set 'user' variable
1818 set_fact :
1919 user : " {{ backup_yml.stat.pw_name }}"
2020
3131 rclone : " {{ rclone | combine(rclone_tmp) }}"
3232 rsync : " {{ rsync | combine(rsync_tmp) }}"
3333
34+ # Restore service
3435- name : " Set 'restore_service_enabled' variable"
3536 set_fact :
3637 restore_service_enabled : " {{ true if not(
You can’t perform that action at this time.
0 commit comments