ansible-role-system/templates/systemd/system/logcompress.service.j2

6 lines
217 B
Django/Jinja

[Unit]
Description=Compress old logs in /var/log/%%Y
[Service]
Type=oneshot
ExecStart=/usr/bin/find /var/log/ -regex '/var/log/2[0-9][0-9][0-9]/2[0-9][0-9][0-9]-[01][0-9]-[0-3][0-9]' -mtime +0 -exec {{command}} {} +