下面是编程之家 jb51.cc 通过网络收集整理的代码片段。
编程之家小编现在分享给大家,也给大家做个参考。
#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH clear; html_code='<!DOCTYPE HTML><html><head><meta charset="utf-8"><link rel="stylesheet" href="css/style.css" type="text/css" media="all"><title>后台数据报告</title></head><h1><strong>后台数据报告</strong></h1><h3><strong>---请点击</strong></h3>' webreport_path="/path/nginx/html/webreport" weblog_path="/path/nginx/logs" function webreport_create() { if [ "01" -eq $(date +"%d") ] ; then reportdate=$(date -d "last month" +"%Y%m"); rm $webreport_path/web$reportdate*\.html else reportdate=$(date -d "yesterday" +"%Y%m%d"); fi if [ -f $weblog_path/access.log-$reportdate\.gz ] ; then zcat -f $weblog_path/access.log-$reportdate\.gz |goaccess -a > $webreport_path/web$reportdate\.htm else cat $weblog_path/access.log-$reportdate |goaccess -a > $webreport_path/web$reportdate\.htm fi sed -i 's/IP/vm/g' $webreport_path/web$reportdate\.html && } function reporthtml_create() { echo $html_code > $webreport_path/index.html for i in $(cd $webreport_path ; echo web* ) do inputhtml="<a href=\"$i\">${i%%.*}</a>" echo $inputhtml >> $webreport_path/index.html done echo "</html>" >> $webreport_path/index.html } webreport_create && reporthtml_create
以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。
如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。