SystemD

Clear Systemd Journal Logs

Is your system running out of disk space and you don’t know where it all went. It might be systemd. Systemd creates Journal Logs that can add up quickly. Here is the information to trim them down.

Check the space that the Journal Logs are using.

$ sudo journalctl --disk-usage

Tell Systemd to rotate the logs

$ sudo journalctl --rotate

Clearing up the logs. You can tell systemd to rotate (and clear) the logs based on number of days old, disk space used, or by the number of files. I like to clean them up based on space used but you can pick one of the following:

$ sudo journalctl --vacuum-time=2days
$ sudo journalctl --vacuum-size=100M
$ sudo journalctl --vacuum-files=5

You can also edit the systemd config file and make it permanent. I like to make sure there is no more than 100M of logs so I would edit the /etc/systemd/journald.conf file and set the SystemMaxUse=100M

Leave a Comment

Your email address will not be published. Required fields are marked *