#!/bin/csh -f
###################################
# Look through the recent WWW access logs to find who accessed the
# Template-based matching download page.
###################################

cd /net/www/var/log/httpd

rm ~/tmp/template_total_list

foreach p (`ls access_log.*.gz`)
	rm ~/tmp/template_list
	gunzip < $p | grep '/cismm/download/templatebasedmatching/template_based_matching_v' | grep -v 152.2. | tee ~/tmp/template_list
	gunzip < $p | grep '/~nanowork/cismm/download/templatebasedmatching/template_based_matching_v' | grep -v 152.2. | tee -a ~/tmp/template_list
	cat ~/tmp/template_list >>! ~/tmp/template_total_list
end

echo "Total number of unique off-site hits:"
cut -f1 -d" " ~/tmp/template_total_list | sort | uniq | wc

echo "Total number of weeks:"
echo `ls access_log.*.gz` | wc

echo "Months covered:"
cut -f2 -d"/" ~/tmp/template_total_list | sort | uniq

