首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CentOS 6.3: and旋转和btmp

CentOS 6.3: and旋转和btmp
EN

Server Fault用户
提问于 2013-10-04 07:38:04
回答 1查看 603关注 0票数 -1

我必须在由其他系统-网络管理机构配置的服务器上配置日志旋转。首先,我检测到没有crond,所以我不得不安装sudo yum install vixie-cron。所有其他设置似乎都可以,/etc/cron.daily/logrotate文件存在。接下来,我运行sudo logrotate -d -f logrotate.conf来检查它是如何工作的。在执行结束时,我看到如下情况:

代码语言:javascript
复制
rotating pattern: /var/log/btmp  forced from command line (1 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/btmp
  log needs rotating
rotating log /var/log/btmp, log->rotateCount is 1
dateext suffix '-20131004'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
renaming /var/log/btmp to /var/log/btmp-20131004
creating new /var/log/btmp mode = 0600 uid = 0 gid = 22

但是,在/var/log/btmp大小相同的情况下,不会发生任何事情,而且/var/log/btmp-20131004也不存在。

EN

回答 1

Server Fault用户

回答已采纳

发布于 2013-10-04 07:50:46

你叫它不要的。在日志旋转上的man页面中:

-d, --debug Turns on debug mode and implies -v. In debug mode, no changes will be made to the logs or to the logrotate state file.

注意"no changes will be made to the logs“。

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/543743

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档