Chinaunix首页 | 论坛 | 博客
  • 博客访问: 630496
  • 博文数量: 95
  • 博客积分: 2091
  • 博客等级: 大尉
  • 技术积分: 982
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-05 19:34
文章分类

全部博文(95)

文章存档

2017年(1)

2016年(20)

2015年(10)

2014年(6)

2013年(4)

2012年(1)

2011年(9)

2010年(6)

2009年(20)

2008年(17)

2007年(1)

我的朋友

分类: 系统运维

2009-04-24 10:31:19

 
Apache 日志按天保存   waynewu 2009-4-24
 
1 首先编写httpd.log.conf,内容如下
/usr/local/apache2.29/logs/access.log {
    daily
    rotate 5
    copytruncate
    compress
    notifempty
    missingok
# This script asks squid to rotate its logs on its own.
# Restarting squid is a long process and it is not worth
# doing it just to rotate logs
    postrotate
      /bin/kill -1 `cat /usr/local/apache2.29/logs/httpd.pid`
    endscript
}
 
2 加入crontab
00 00 * * * /usr/sbin/logrotate -f /usr/local/apache2.29/conf/httpd.log.con
阅读(1889) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~