解决awstats跨月分析日志问题及其他改进
来源:互联网 发布:女神联盟女神进阶数据 编辑:程序博客网 时间:2024/05/22 21:28
1。生成静态统计页面的脚本,每天执行一次
# more autolog
#!/bin/bash
pl=/usr/lib/cgi-bin/awstats.pl
static=/usr/lib/cgi-bin/awstats_buildstaticpages.pl
datadir=/data/webroot/awstats/
htmldir=/data/webroot/awstats/
datatime=$(date +%Y%m)
firstday=$(date +%d)
lastmonth=$(date +%m --date='1 days ago')
lastmonthyear=$(date +%Y%m --date='1 days ago')
domain1=www.china.com
domain2=cin.china.com
domain3=spo.china.com
echo $firstday
echo $lastmonth
echo $lastmonthyear
#创建当月目录
if [ -d $datadir$datatime ]; then
echo "$datadir$datatime目录存在 ."
else
mkdir $datadir$datatime
fi
#判断是否是月初第一天
if [ $firstday = "01" ]; then
echo "月初第一天 ."
#生成上月的静态统计页面
for domain in $domain1 $domain2 $domain3;do
$static -config=$domain -update -month=$lastmonth -year=2010 -awstatsprog=$pl -dir=$datadir$lastmonthyear
done
else
if [ $firstday = "02" ]; then
echo "月初第二天 ."
#生成当月静态统计页面并且更新web统计页面左侧导航链接
for domain in $domain1 $domain2 $domain3;do
$static -config=$domain -update -awstatsprog=$pl -dir=$datadir$datatime
done
echo "<a href=/"$datatime/awstats.w.china.com.html/"target=main><font color=#0000ff>${datatime}wo</font></
a>
<a href=/"$datatime/awstats.cin.china.com.html/"target=main><font color=#0000ff>${datatime}movie</font></a>
<a href=/"$datatime/awstats.spt.china.com.html/"target=main><font color=#0000ff>${datatime}sport</font></a>" >$h
tmldir/tmp.html
cat $htmldir/indexleft.html >> $htmldir/tmp.html
mv $htmldir/tmp.html $htmldir/indexleft.html
else
echo "不是月初前2天 ."
#生成当月静态统计页面
for domain in $domain1 $domain2 $domain3;do
$static -config=$domain -update -awstatsprog=$pl -dir=$datadir$datatime
done
fi
fi
2。分析页面使用frameset技术的导航
# more index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html>
<head>
<title></title>
</head>
<!-- <frameset rows="60, *"> -->
<frameset cols="11%, *">
<frame src="indexleft.html" />
<frame name="main" src="201007/awstats.www.china.com.html" />
<noframes>
<body>
</body>
</noframes>
</frameset>
</html>
3。导航页
# more indexleft.html
<a href="201007/awstats.www.china.com.html"target=main><font color=#0000ff>201007wo</font></a>
<a href="201007/awstats.cin.china.com.html"target=main><font color=#0000ff>201007movie</font></a>
<a href="201007/awstats.spt.china.com.html"target=main><font color=#0000ff>201007sport</font></a>
- 解决awstats跨月分析日志问题及其他改进
- awstats分析nginx日志
- awstats-日志分析软件
- 日志分析系统 --- AWStats
- Awstats分析Nginx日志
- awstats分析nginx日志
- Awstats分析nginx日志
- awstats分析apche日志
- 使用awstats分析apache日志
- 使用awstats分析apache日志
- 利用awstats分析tomcat日志
- awstats 分析 Nginx 访问日志
- Awstats日志分析工具部署
- awstats分析多个日志
- 使用awstats分析nginx日志
- Awstats网站日志分析工具
- 利用Awstats分析网站日志
- Nginx日志分析解决方案awstats
- [sql server] 锁知识
- 10个你也许不知道的Ubuntu技巧
- SVN操作
- Servlet线程安全相关问题
- luabind常用方法总结
- 解决awstats跨月分析日志问题及其他改进
- C#获取本机连接的打印机属性
- 怎样远程连接服务器上的MySql?
- 临时表空间过大的处理,对用户表空间操作。
- Hibernate 的一些注意点
- How to read file in Java – BufferedInputStream Example
- sql操作日期大全
- parse and display a BMP image in the Flash Player using the ByteArray class
- 介绍Java如何获得文件编码格式