赞
踩
ubuntu中的系统日志文件件如不及时清理,时间长了会占用硬盘的空间,如下所示:
/var/log/journal/4321d62ad63d44cbbc4dff3b6e282b26/system@9f5b4d5081d24b319f8b4677cf673a97-0000000000184ca6-00061412655a5a79.journal:
128M
/var/log/journal/4321d62ad63d44cbbc4dff3b6e282b26/system@9f5b4d5081d24b319f8b4677cf673a97-0000000000213c23-0006141d2e7210a9.journal:
120M
/var/log/journal/4321d62ad63d44cbbc4dff3b6e282b26/system@9f5b4d5081d24b319f8b4677cf673a97-000000000023069c-000615482d6c5bc0.journal:
128M
/var/log/journal/4321d62ad63d44cbbc4dff3b6e282b26/system@9f5b4d5081d24b319f8b4677cf673a97-000000000015e7e0-0006140f6ec5dd4f.journal:
128M
/var/log/journal/4321d62ad63d44cbbc4dff3b6e282b26/system@9f5b4d5081d24b319f8b4677cf673a97-0000000000138365-0006140c5f17b0f1.journal:
128M
/var/log/journal/4321d62ad63d44cbbc4dff3b6e282b26/system@9f5b4d5081d24b319f8b4677cf673a97-00000000002567ec-0006154aa5e2dc36.journal:
120M
如何限制系统日志文件的大小?
journalctl --disk-usage
sudo nano /etc/systemd/journald.conf
在文件中找到 SystemMaxUse 参数,将其值设置为 1G。如果这个参数不存在,你可以添加一行 SystemMaxUse=1G。
4. 重启配置文件:
sudo systemctl restart systemd-journald
systemctl status systemd-journald
journalctl -n 1 --reverse```
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。