awstats日志分析脚本、合并日志文件

#!/bin/sh
if [ ! -d /home/passport_log_tmp ] && [ ! -d /usr/local/nginx/html/awstats/passport.xxx.com ];then
    mkdir -p /usr/local/nginx/html/awstats/passport.xxx.com
    mkdir -p /home/passport_log_tmp
fi

rm -rf /home/passport_log_tmp/access_*.log

find /home/passport_log/web[1-2]/ -iname access_`date -d "yesterday" +%y%m%d`.log \
         -exec cat {} >> /home/passport_log_tmp/access_`date -d "yesterday" +%Y%m%d`.log \;

/usr/local/awstats/tools/awstats_buildstaticpages.pl -update \
        -config=passport.coocaa.com \
        -lang=cn \
        -dir=/usr/local/nginx/html/awstats/passport.coocaa.com \
        -awstatsprog=/usr/local/awstats/wwwroot/cgi-bin/awstats.pl


日志合并 

#!/bin/sh
find /data/log/tomcat/tomcat[1-3]/ -iname catalina.`date -d "yesterday" +%Y-%m-%d`.log \
         -exec cat {} >> /data/log/tomcat/all_tomcat/catalina.`date -d "yesterday" +%Y-%m-%d`.log \;

你可能感兴趣的:(awstats)