fixed bug in etcd retention where backups are not sorted by date (#6860)
* fixed bug in etcd retention where backups are not sorted by date * added directory filter to find command
This commit is contained in:
parent
d36b5d7d55
commit
097bec473c
1 changed files with 1 additions and 1 deletions
|
@ -62,5 +62,5 @@
|
||||||
- name: Remove old etcd backups
|
- name: Remove old etcd backups
|
||||||
shell:
|
shell:
|
||||||
chdir: "{{ etcd_backup_prefix }}"
|
chdir: "{{ etcd_backup_prefix }}"
|
||||||
cmd: "find . -name 'etcd-*' | head -n -{{ etcd_backup_retention_count }} | xargs rm -rf"
|
cmd: "find . -name 'etcd-*' -type d | sort -n | head -n -{{ etcd_backup_retention_count }} | xargs rm -rf"
|
||||||
when: etcd_backup_retention_count >= 0
|
when: etcd_backup_retention_count >= 0
|
||||||
|
|
Loading…
Reference in a new issue