mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-14 05:45:06 +03:00
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:
@@ -62,5 +62,5 @@
|
||||
- name: Remove old etcd backups
|
||||
shell:
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user