Collect weekly backups on monday.

This commit is contained in:
2021-11-22 06:09:08 +01:00
parent 0f589445dc
commit 42b117fb9a

View File

@@ -113,7 +113,7 @@
src: "{{ item.path }}"
dest: "{{ item.path | dirname }}/weekly/{{ item.path | basename }}"
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
when: (ansible_date_time.weekday_number == "7")
when: (ansible_date_time.weekday_number == "1")
loop_control:
label: "{{ item.path }}"
@@ -123,7 +123,7 @@
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 != "7" and ansible_date_time.day != "01")
when: (ansible_date_time.weekday_number != "1" and ansible_date_time.day != "01")
loop_control:
label: "{{ item.path }}"