Skip to content

System Management

Logs

JournalD

Check current journal disk usage:

Show journald disk usage
journalctl --disk-usage

Set a persistent size cap in /etc/systemd/journald.conf:

Limit persistent journal size
[Journal]
SystemMaxUse=1G
SystemKeepFree=500M

Apply the config change:

Restart journald
sudo systemctl restart systemd-journald

Vacuum old logs immediately without changing the long-term config:

Vacuum by size or age
sudo journalctl --vacuum-size=500M
sudo journalctl --vacuum-time=14d

Docker Logs

Truncate all docker logs at 0
sudo systemctl stop docker
sudo find /var/lib/docker/containers/ -name '*-json.log' -exec truncate -s 0 {} \;
sudo systemctl start docker