Please wait...
Suggest:

How to clean journalctl logs

Last update at November 15, 2023 by
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'

Postingan Lainnya

©2024