How to clean journalctl logs

The self maintenance method is to vacuum the logs by size or time.

Retain only the past one day:

journalctl --vacuum-time=1d

Retain only the past only 100 MB:

journalctl --vacuum-size=100M

You can also limit the log file size by doing a little configuration in the following file.

...
SystemMaxUse=100M
...

The configuration will run when the server is restarted or restarted of the journald service:

systemctl restart systemd-journald

For more information you can talk about it in the journalctl documentation with the command 'man journalctl'

Inside of Code
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.