copr/hv: delete logs older than 30 days
We have old RHEL 8 on hypervisors where is old version of virtlogd, not having the max_age log rotation feature, thus doing this manually.
This commit is contained in:
parent
69237d1349
commit
2dc4a6b5c0
2 changed files with 9 additions and 17 deletions
|
@ -1,7 +0,0 @@
|
||||||
# We log each WM that has beed spawned to a log and once it shuts down
|
|
||||||
# the log is closed and we keep that small log. New machines logs their
|
|
||||||
# output to new file. So this way we keep the small logs of each WM
|
|
||||||
# for 30 days.
|
|
||||||
max_age_days = 30
|
|
||||||
|
|
||||||
log_root = "/var/log/libvirt/qemu"
|
|
|
@ -201,13 +201,12 @@
|
||||||
provision_user: copr
|
provision_user: copr
|
||||||
tags: always
|
tags: always
|
||||||
|
|
||||||
- name: Deploy virtlogd.conf
|
- name: Ensure weekly cleanup of virtlogd/qemu logs older than 30 days
|
||||||
ansible.builtin.copy:
|
ansible.builtin.cron:
|
||||||
src: virtlogd.conf
|
name: "Cleanup old virtlogd-qemu logs"
|
||||||
dest: /etc/libvirt/virtlogd.conf
|
minute: 0
|
||||||
owner: root
|
hour: 3
|
||||||
group: root
|
weekday: 1
|
||||||
mode: '0644'
|
user: root
|
||||||
notify: Reload virtlogd
|
job: |
|
||||||
tags:
|
find /var/log/libvirt/qemu -maxdepth 1 -type f -name '*.log' -mtime +30 -delete
|
||||||
- config
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue