From 334793578061b51533526a51309942b20c87a7b6 Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Sat, 10 Oct 2020 11:00:32 -0500 Subject: [PATCH] Add /var/log/syslog/ clean up cron job --- roles/rsyslog/tasks/archival.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/rsyslog/tasks/archival.yaml b/roles/rsyslog/tasks/archival.yaml index 102b52c..a7ed976 100644 --- a/roles/rsyslog/tasks/archival.yaml +++ b/roles/rsyslog/tasks/archival.yaml @@ -77,5 +77,7 @@ minute: "0" hour: "2" user: root - job: find /var/log/syslog/ -mindepth 4 -type f -name "*.log" -mtime +90 -delete + job: > + find /var/log/syslog/ -mindepth 4 -type f -name "*.log.xz" -mtime +90 -delete && + find /var/log/syslog/ -mindepth 3 -type d -empty -delete state: "{{ rsyslog_archival_format_enabled | ternary('present', 'absent') }}"