最近我更改了 letsencrypt 的日志配置,因为没有给定的配置并且我有文件:
letsencrypt.log
letsencrypt.log.1
letsencrypt.log.10
letsencrypt.log.10.gz
letsencrypt.log.11
letsencrypt.log.11.gz
letsencrypt.log.12
letsencrypt.log.12.gz
letsencrypt.log.13
letsencrypt.log.13.gz
letsencrypt.log.14
letsencrypt.log.14.gz
letsencrypt.log.15
letsencrypt.log.15.gz
letsencrypt.log.16
letsencrypt.log.16.gz
其中偶数文件有 1409 个字节,奇数文件有 0 个字节。然而,压缩文件有一些内容(不同)。日志轮换的配置是:
/var/log/letsencrypt/*.log {
daily
rotate 32
compress
delaycompress
missingok
notifempty
create 644 root root
}
我应该如何更改日志轮换配置以仅保留:
- 前两个文件没有压缩,
- 其余文件压缩,
- 摆脱空文件?
好的,所以我设法使正确的日志轮换:
所以区别在于我已经删除了
notifempty
.