Cleanup a /var/log/journal

We can delete everything inside of /var/log/journal/* but do not delete the directory itself. You can also query journalctl to find out how much disk space it’s consuming:

journalctl --disk-usage

You can control the size of this directory using this parameter in your

/etc/systemd/journald.conf
SystemMaxUse=50M

You can force a log rotation:

sudo systemctl kill --kill-who=main --signal=SIGUSR2 systemd-journald.service

You might need to restart the logging service to force a log rotation if the above signaling method does not do it. You can restart the service like so:

sudo systemctl restart systemd-journald.service

Note: You could always go and delete the offending /var/log/journal/** directory contents, but this is not the recommended way, as the system journal is being written to it, which will probably cause you bigger problems!

Simply run the following command to cleanup the /var/log/journal directory:

journalctl --vacuum-size=50M

This will delete old log files until the directory reaches the threshold size stipulated.

Related posts

Latest posts

Leave a Comment

Leave a Reply

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