添加 'linux基础/清理journal日志.md'

This commit is contained in:
iProbe 2022-12-13 10:16:44 +08:00
parent a5628cf90f
commit 582422d5f0

View file

@ -0,0 +1,15 @@
## 临时清理
```bash
> /var/log/journal/xxx/system.journal
```
## 自动维护
```bash
# 保留近1周日志
journalctl --vacuum-time=1w
# 保留500M日志
journalctl --vacuum-size=500M
```
注意: 若提示Error was encountered while opening journal files: Input/output error,则表明文件损坏,删除日志,并重启
```bash
systemctl restart systemd-journald.service
```