Browse Source

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
pull/6857/head
axelgobletbdr 4 years ago
committed by GitHub
parent
commit
097bec473c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. 2
      roles/etcd/handlers/backup.yml

2
roles/etcd/handlers/backup.yml

@ -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
Loading…
Cancel
Save