Cleanup original backup files.
This commit is contained in:
@@ -60,7 +60,7 @@
|
|||||||
with_items: "{{ subdirs.results }}"
|
with_items: "{{ subdirs.results }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.item[0] }} {{ item.item[1] }}"
|
label: "{{ item.item[0] }} {{ item.item[1] }}"
|
||||||
|
|
||||||
- name: Store the yearly backups
|
- name: Store the yearly backups
|
||||||
copy:
|
copy:
|
||||||
remote_src: true
|
remote_src: true
|
||||||
@@ -92,4 +92,9 @@
|
|||||||
dest: "{{ backup_dir }}/{{ item }}/daily/{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
|
dest: "{{ backup_dir }}/{{ item }}/daily/{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
|
||||||
loop: "{{ databases }}"
|
loop: "{{ databases }}"
|
||||||
when: (ansible_date_time.weekday_number != "7" and ansible_date_time.day != "01")
|
when: (ansible_date_time.weekday_number != "7" and ansible_date_time.day != "01")
|
||||||
|
|
||||||
|
- name: Cleanup original backup files
|
||||||
|
file:
|
||||||
|
path: "{{ backup_dir }}/{{ item }}/{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
|
||||||
|
state: absent
|
||||||
|
loop: "{{ databases }}"
|
||||||
Reference in New Issue
Block a user