Limit the size of log files
Logs can take a lot of space. To avoid my disk to be full of old unnecessary logs I’ve taken the following measures :
- My logs files must not take more than 250Mo
- My logs must not be older than 1 week on my personal computer In order to achieve these goals I’ll edit the following lines in the conf file : /etc/systemd/journald.conf
MaxRetentionSec=1week
SystemMaxUse=250M
Then I’ll apply the settings : sudo systemctl restart systemd-journald
I’ll check if the logs are cleared and clear them myself if it’s not the case :
sudo journalctl --vacuum-size=250M
sudo journalctl --vacuum-time=7d