Code formatting for variable names and fix file age for cleaning daily backup .
This commit is contained in:
14
odroid.yaml
14
odroid.yaml
@@ -139,18 +139,18 @@
|
||||
find:
|
||||
paths: "{{ backup_dir }}/{{ item }}/daily"
|
||||
file_type: file
|
||||
age: 1m
|
||||
age: 8d
|
||||
age_stamp: ctime
|
||||
patterns: '*.gz'
|
||||
recurse: false
|
||||
register: oldBackups
|
||||
register: backup_files
|
||||
loop: "{{ systems }}"
|
||||
|
||||
- name: Delete old daily backups
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
with_items: "{{ oldBackups.results | map(attribute='files') | list }}"
|
||||
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
|
||||
@@ -162,14 +162,14 @@
|
||||
age_stamp: ctime
|
||||
patterns: '*.gz'
|
||||
recurse: false
|
||||
register: oldBackups
|
||||
register: backup_files
|
||||
loop: "{{ systems }}"
|
||||
|
||||
- name: Delete old weekly backups
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
with_items: "{{ oldBackups.results | map(attribute='files') | list }}"
|
||||
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
|
||||
@@ -181,14 +181,14 @@
|
||||
age_stamp: ctime
|
||||
patterns: '*.gz'
|
||||
recurse: false
|
||||
register: oldBackups
|
||||
register: backup_files
|
||||
loop: "{{ systems }}"
|
||||
|
||||
- name: Delete old monthly backups
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
with_items: "{{ oldBackups.results | map(attribute='files') | list }}"
|
||||
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user