清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/ local /bin:/usr/ local /sbin:~/bin export PATH clear ; html_code='& lt ;!DOCTYPE HTML& gt ;& lt ;html& gt ;& lt ; head & gt ;& lt ;meta charset= "utf-8" & gt ;& lt ;link rel= "stylesheet" href= "css/style.css" type = "text/css" media= "all" & gt ;& lt ;title& gt ;后台数据报告& lt ;/title& gt ;& lt ;/ head & gt ;& lt ;h1& gt ;& lt ;strong& gt ;后台数据报告& lt ;/strong& gt ;& lt ;/h1& gt ;& lt ;h3& gt ;& lt ;strong& gt ;---请点击& lt ;/strong& gt ;& lt ;/h3& gt ;' 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 & gt ; $webreport_path/web$reportdate\.htm else cat $weblog_path/access.log-$reportdate |goaccess -a & gt ; $webreport_path/web$reportdate\.htm fi sed -i 's/IP/vm/g' $webreport_path/web$reportdate\.html && } function reporthtml_create() { echo $html_code & gt ; $webreport_path/index.html for i in $( cd $webreport_path ; echo web* ) do inputhtml= "<a href=\"$i\">${i%%.*}</a>" echo $inputhtml & gt ;& gt ; $webreport_path/index.html done echo "</html>" & gt ;& gt ; $webreport_path/index.html } webreport_create && reporthtml_create |