#!/bin/bash #ticker all year #pom 9-1-2560 #wiboon 8-6-2561 youroffice=CLIB-WINDOWS ip1=$ip -4 address show dev eth0 | grep inet | awk '{ print $2 }' | cut -f1 -d/() dir1=/var/www/ticker/datalog dir2=/var/www/test/report/tickersortallmonth if [ ! -d ${dir2} ] ; then mkdir -p ${dir2} fi year1=$(date +%Y) file1=/var/www/test/report/index.html #cp $file1 $file1.$(date +%F) cat /dev/null > ${file1} echo "
Year | Summary \ Month | " >> ${file1} #------ loop echo month for i in $(seq -f "%02g" 12) do echo "${i} | " >> ${file1} done #pom make summary all year table 9-1-2017 echo "Summary all year | " >> ${file1} echo "|
${yeara} | " >> ${file1} #------ summary faculty zone pc all year for name1 in faculty zone student pc do # for name1 #pom echo $yeara-$name1 echo "  | " >> ${file1} else echo "${sum0} | " >> ${file1} fi done #------pom show amount sum all year 9-1-2017 sumallyear=$(grep -rih [0-9] ${dir1}/${yeara}/ | wc -l) echo "${sumallyear} | " >> ${file1} echo "|
---|---|---|---|---|
  | " >> ${file1} else date1=${yeara}-${month1} file2=${dir2}/${date1}.txt cat /dev/null > ${file2} echo "${sum1} | " >> ${file1} echo "${date1} sum = ${sum1} Sort User Usage Descending" >> ${file2} grep -rih [0-9] ${dir1}/${yeara}/${month1}/ | cut -d\: -f5,10 | grep -v "<" | sort | uniq -c | sort -r -t" " -n -k1,1 -k2 >> ${file2} fi done echo "${sumallyear} | " >> ${file1} echo "