diff --git a/roles/rsyslog/tasks/archival.yaml b/roles/rsyslog/tasks/archival.yaml index a637e7a..08b1c57 100644 --- a/roles/rsyslog/tasks/archival.yaml +++ b/roles/rsyslog/tasks/archival.yaml @@ -68,5 +68,5 @@ minute: "0" hour: "1" user: root - job: find /var/log/syslog/ -type f ! -name "*$(date +\%Y\%m\%d)*.log" -name "*.log" -exec xz {} \; + job: find /var/log/syslog/ -type f -name "*.log" -mtime +5 -exec xz {} \; state: "{{ rsyslog_archival_format_enabled | ternary('present', 'absent') }}"