FAQ_MA35D1_Clean Systemd Cache and Log
Posted: 07 Apr 2023, 17:19
Running certain applications may result in a large amount of cache and logs being stored in the /run/log/journal and /var/run/journal directories, which can consume a significant amount of disk space and potentially cause system errors. To address this issue, you can limit the size of the systemd logs or clean up older logs using the journalctl command.
To clean up the systemd runtime log created before 10 seconds, you can use the following command:
To limit the systemd log size to 16 MB, you can modify the /etc/systemd/journald.conf file as follows:
After modifying the configuration file, you should restart the systemd journal service using the following command:
This will ensure that the changes to the systemd journal's configuration take effect immediately.
To clean up the systemd runtime log created before 10 seconds, you can use the following command:
Code: Select all
journalctl --vacuum-time=10s
Code: Select all
vi /etc/systemd/journald.conf SystemMaxUse=16M
Code: Select all
systemctl restart systemd-journald