编辑/etc/systemd/journald.conf文件
将SystemMaxUse 和 MaxRetentionSec 前面的#去掉
SystemMaxUse 用于设置整个日志存储目录允许占用的最大空间
MaxRetentionSec 用于设置日志文件的最长保留时间,单位是秒
- SystemMaxUse=1G
- MaxRetentionSec=604800
复制代码
保存配置后,重启服务systemd-journald生效
- systemctl restart systemd-journald
复制代码 |