免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 7165 | 回复: 17
打印 上一主题 下一主题

怪问题,log不轮转了,文件越来越大,logrotate配置也没问题~有新进展 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-10-22 22:12 |只看该作者 |倒序浏览
轮转的日志到2008-11-30就不走了
怪问题,log不轮转了,文件越来越大,logrotate配置也没问题。
请前辈指教,操作系统是rhel as 4.0
以下是配置文件,请帮忙分析下:
more /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
}

# system-specific logs may be also be configured here.
[root@localhost logrotate.d]#
[root@localhost logrotate.d]# pwd
/etc/logrotate.d
[root@localhost logrotate.d]# ls
acpid  cups  mgetty  named  ppp  psacct  rpm  snmpd  syslog  up2date  vsftpd.log
[root@localhost logrotate.d]# more syslog
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}
[root@localhost logrotate.d]# service crond status
crond (pid 2592) is running...


[root@localhost logrotate.d]# more /etc/cron.daily/logrotate
#!/bin/sh

/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0

[ 本帖最后由 fhzjgd 于 2009-10-26 12:22 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2009-10-23 00:24 |只看该作者
至少你要說清楚是那邊的 log,還有你的 logrotate 怎樣配置的。

论坛徽章:
0
3 [报告]
发表于 2009-10-23 12:13 |只看该作者
logrotae是默认配置,谁也没动过

论坛徽章:
0
4 [报告]
发表于 2009-10-23 15:15 |只看该作者
哪个log文件?还是整个/var/log目录下的?

论坛徽章:
0
5 [报告]
发表于 2009-10-23 22:32 |只看该作者
整个/var/log下的log文件都这样,都不轮转了

论坛徽章:
5
寅虎
日期:2015-01-20 09:16:52亥猪
日期:2015-01-21 14:43:44IT运维版块每日发帖之星
日期:2015-12-17 06:20:00每日论坛发贴之星
日期:2015-12-17 06:20:00每周论坛发贴之星
日期:2015-12-20 22:22:00
6 [报告]
发表于 2009-10-24 08:58 |只看该作者
怎么判断楼主哪里出问题?我是没头绪啊

论坛徽章:
0
7 [报告]
发表于 2009-10-25 09:53 |只看该作者
顶上来,很头痛

论坛徽章:
0
8 [报告]
发表于 2009-10-25 11:28 |只看该作者
你的crond服务启动了吗?
如果crond服务没有启动,那么你的这种情况就是正常的了。

chkconfig --list crond
service crond status

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
9 [报告]
发表于 2009-10-25 11:43 |只看该作者

回复 #8 marsaber 的帖子

有道理,楼主检查下cron服务是否运行

论坛徽章:
0
10 [报告]
发表于 2009-10-26 09:43 |只看该作者
cron都正常的
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP