我的Ubuntu18LTS服务器中的日志文件似乎没有被压缩,尽管在默认情况下是启用压缩的(我没有在/etc/systemd/journald.conf中更改它),而且journalctl声称看到了压缩文件:
# journalctl --header | grep PRESS | uniq
Incompatible Flags: COMPRESSED-LZ4
# journalctl --disk-usage
Archived and active journals take up 4.0G in the file system.
# journalctl -o verbose | wc
4 GB in 90 Mio lines # about the same size as the journal files itself
# journalctl -o verbose | gzip | wc -c
193 MB # reduced by a factor of 20
grep -v '^#' /etc/systemd/journald.conf
[Journal]
Storage=persistent
SystemMaxUse=4G
SystemKeepFree=4G
SystemMaxFileSize=100M
MaxFileSec=1week
SyncIntervalSec=1
LineMax=1K
ForwardToConsole=yes
MaxLevelConsole=crit
MaxLevelWall=alert
RateLimitIntervalSec=2min
RateLimitBurst=2000当我试图压缩其中一个/var/log/journal/*/*.journal文件时,我看到压缩了5倍,而我知道已经压缩的数据不能被另一个压缩器压缩,因此这些文件似乎被解压缩了。
如何让systemd-journald压缩我的日记?
发布于 2021-01-31 05:12:41
Systemd似乎没有将压缩应用于整个日志文件,而是选择性地应用于日志中的数据块。这是不如批发压缩,因为你发现自己。对于开发人员来说,问题是养大。
https://askubuntu.com/questions/1265841
复制相似问题