diff --git a/systemd/journald.conf b/systemd/journald.conf index ae0811f..ca4c1e0 100644 --- a/systemd/journald.conf +++ b/systemd/journald.conf @@ -32,7 +32,7 @@ SystemMaxFiles=10000 #RuntimeKeepFree= #RuntimeMaxFileSize= #RuntimeMaxFiles=100 -MaxRetentionSec={{journald_max_retention_sec}} +#MaxRetentionSec= MaxFileSec=1day #ForwardToSyslog=no #ForwardToKMsg=no diff --git a/systemd/system/systemd-journald-vacuum.service b/systemd/system/systemd-journald-vacuum.service new file mode 100644 index 0000000..ce32e38 --- /dev/null +++ b/systemd/system/systemd-journald-vacuum.service @@ -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}} diff --git a/systemd/system/systemd-journald-vacuum.timer b/systemd/system/systemd-journald-vacuum.timer new file mode 100644 index 0000000..0190bdf --- /dev/null +++ b/systemd/system/systemd-journald-vacuum.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Run systemd-journald-vacuum hourly + +[Timer] +OnCalendar=hourly + +[Install] +WantedBy=timers.target