[logrotate]log does not need rotating (log size is below the ‘size‘ threshold)

当minsize参数未设置时,如果发现系统提示与空的日志文件相关,原因可能是源日志文件目前没有任何内容。这种情况通常影响到某些依赖日志大小的监控或处理机制。

如果没有配置过minsize相关参数,出现这个提示的原因是因为源日志文件是空的

[root@VM-24-3-centos ~]# logrotate -vf /etc/logrotate.d/nginx reading config file /etc/logrotate.d/nginx Allocating hash table for state file, size 15360 B Handling 1 logs rotating pattern: /var/log/nginx/*.log forced from command line (7 rotations) empty log files are not rotated, old logs are removed considering log /var/log/nginx/access.log log needs rotating considering log /var/log/nginx/backup.log log does not need rotating (log is empty)considering log /var/log/nginx/error.log log needs rotating rotating log /var/log/nginx/access.log, log->rotateCount is 7 Converted ' -%Y%m%d' -> '-%Y%m%d' dateext suffix '-20250922' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' compressing log with: /bin/gzip destination /var/log/nginx/access.log-20250922 already exists, skipping rotation rotating log /var/log/nginx/error.log, log->rotateCount is 7 Converted ' -%Y%m%d' -> '-%Y%m%d' dateext suffix '-20250922' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' compressing log with: /bin/gzip destination /var/log/nginx/error.log-20250922 already exists, skipping rotation Removing /var/log/wtmp from state file, because it does not exist and has not been rotated for one year Removing /var/log/spooler from state file, because it does not exist and has not been rotated for one year Removing /var/log/maillog from state file, because it does not exist and has not been rotated for one year Removing /var/log/secure from state file, because it does not exist and has not been rotated for one year Removing /var/log/messages from state file, because it does not exist and has not been rotated for one year Removing /var/log/cron from state file, because it does not exist and has not been rotated for one year
09-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值