Move daily backups.
This commit is contained in:
@@ -58,5 +58,15 @@
|
|||||||
recurse: false
|
recurse: false
|
||||||
register: backup_files
|
register: backup_files
|
||||||
loop: "{{ backup_dirs.files }}"
|
loop: "{{ backup_dirs.files }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.path }}"
|
||||||
|
|
||||||
- debug: var=backup_files
|
- name: Store the daily backup
|
||||||
|
copy:
|
||||||
|
remote_src: true
|
||||||
|
src: "{{ item.path }}"
|
||||||
|
dest: "{{ item.path | dirname }}/daily/{{ item.path | basename }}"
|
||||||
|
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
|
||||||
|
when: (ansible_date_time.weekday_number != "1" and ansible_date_time.day != "01")
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.path }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user