#!/bin/ksh print_header() { cat << MOS Top Genie User Page Downloads

Top my.genie homepage downloads

This is a list of the top downloads from the my.genie homepages. The purpose of this tool is to easily identify the largest files being transferred from the my.genie home pages.

Experience tells us that if there are a large number of downloads over 5MB then the overall performance is degraded.

MOS } print_footer() { DATESTAMP="$(date)" cat << MOS

Tool provided by Michael O'Sullivan - Omni Modo Limited
Automatically Generated: ${DATESTAMP} MOS } function make_table_header { echo '' echo '' for i in `head -1 $1`; do echo ' done echo '' } make_data_html() { echo '
$i
' >> ${TMP_FILE2} echo '' >> ${TMP_FILE2} TOPTEN=$(cat ${TMP_FILE} | awk '{print $2}') for i in ${TOPTEN}; do first_char=$(echo $i | cut -c2) second_char=$(echo $i | cut -c3) third_char=$(echo $i | cut -c4) bigfile="/home/genie/${first_char}/${second_char}/${third_char}${i}" FILEDETAILS=$(ls -s -- "${bigfile}") if [ -f ${bigfile} ]; then filesize=$(echo ${FILEDETAILS} | awk '{print $1}') filesize=$(expr ${filesize} / 2) filename=$(echo ${FILEDETAILS} | awk '{print $2}') echo "" >> ${TMP_FILE2} echo "" >> ${TMP_FILE2} echo " \n " >> ${TMP_FILE2} fi done echo "
URL UNIX File size (kb) UNIX file name
http://my.genie.co.uk$i ${filesize} ${filename}
" >> ${TMP_FILE2} } # Main program gather_data print_data print_header > ${TMP_FILE2} make_data_html print_footer >> ${TMP_FILE2} cp ${TMP_FILE2} /home/genie/t/h/e/theleprechaun/top10.html rm ${TMP_FILE} ${TMP_FILE1} ${TMP_FILE2} exit 0