brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: SystemMaxUse in journald.conf.d keeps journalctl history within a size limit

Journalctl
~/tips/tip-journalctl-journald-systemmaxuse-rotate

[Journal]

Caps the size and age of the stored journal permanently with a small config drop-in.

A one-off vacuum helps once, but a permanent cap keeps the problem away.

# /etc/systemd/journald.conf.d/size.conf
[Journal]
SystemMaxUse=500M
MaxRetentionSec=1month

SystemMaxUse= limits the total size of persistent journal files, and MaxRetentionSec= deletes entries older than one month. A drop-in directory keeps your changes apart from the packaged file. Apply them with sudo systemctl restart systemd-journald, and run journalctl --rotate to close the current file so older data can be removed sooner. Size limits apply to whole files, so the size can exceed the value slightly. Check the effect with journalctl --disk-usage.

Further reading: journald.conf manual page

More Journalctl tips journalctl -k -g 'killed process' --since "2 days ago" journalctl _PID=1 -b ls -lh /var/log/journal/*/*.journal~ Storage=volatile sudo journalctl --setup-keys All Journalctl tips (81) All topics

Link