Move the backups to the right folders.
This commit is contained in:
26
odroid.yaml
26
odroid.yaml
@@ -62,10 +62,34 @@
|
|||||||
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:
|
||||||
|
remote_src: true
|
||||||
|
src: "{{ backup_dir }}/{{ item }}/{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
|
||||||
|
dest: "{{ backup_dir }}/{{ item }}/yearly/{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
|
||||||
|
loop: "{{ databases }}"
|
||||||
|
when: (ansible_date_time.day == "01" and ansible_data_time.month == "01")
|
||||||
|
|
||||||
|
- name: Store the monthly backups
|
||||||
|
copy:
|
||||||
|
remote_src: true
|
||||||
|
src: "{{ backup_dir }}/{{ item }}/{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
|
||||||
|
dest: "{{ backup_dir }}/{{ item }}/monthly/{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
|
||||||
|
loop: "{{ databases }}"
|
||||||
|
when: (ansible_date_time.day == "01" and ansible_data_time.month != "01")
|
||||||
|
|
||||||
|
- name: Store the weekly backups
|
||||||
|
copy:
|
||||||
|
remote_src: true
|
||||||
|
src: "{{ backup_dir }}/{{ item }}/{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
|
||||||
|
dest: "{{ backup_dir }}/{{ item }}/weekly/{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
|
||||||
|
loop: "{{ databases }}"
|
||||||
|
when: (ansible_date_time.weekday_number == "7")
|
||||||
|
|
||||||
|
- name: Store the daily backups
|
||||||
copy:
|
copy:
|
||||||
remote_src: true
|
remote_src: true
|
||||||
src: "{{ backup_dir }}/{{ item }}/{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
|
src: "{{ backup_dir }}/{{ item }}/{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
|
||||||
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")
|
||||||
|
|
||||||
Reference in New Issue
Block a user