replace MaxRetentionSec to stop excessive rotation

This commit is contained in:
Daniel Micay 2024-02-13 11:16:17 -05:00
parent d39937fc6c
commit e81e9feef3
3 changed files with 18 additions and 1 deletions

View File

@ -32,7 +32,7 @@ SystemMaxFiles=10000
#RuntimeKeepFree=
#RuntimeMaxFileSize=
#RuntimeMaxFiles=100
MaxRetentionSec={{journald_max_retention_sec}}
#MaxRetentionSec=
MaxFileSec=1day
#ForwardToSyslog=no
#ForwardToKMsg=no

View File

@ -0,0 +1,9 @@
[Unit]
Description=Vacuum journald logs
After=systemd-journald.service
[Service]
Type=oneshot
User=root
Group=root
ExecStart=/usr/bin/journalctl --vacuum-time={{journald_max_retention_sec}}

View File

@ -0,0 +1,8 @@
[Unit]
Description=Run systemd-journald-vacuum hourly
[Timer]
OnCalendar=hourly
[Install]
WantedBy=timers.target