# This is a script written by Prashanth Mohan # for calculating the total bandwidth usage on the dataone connection. # For usage.. copy the usage pattern (the table in Service records once you # log into http://10.240.43.216) into a text file (say usage.txt). # Please NOTE that there is an inital tab in each line of the table.. make # sure you copy the tab on the first line. Copy all the pages in the table # sequentially and make sure you the formatting is right on the text file. # Then run "awk -f " BEGIN { print "\tDataOne Download Finder v0.2"; total=0; redsum=0; send=0; rec=0; time=0; } { if ($5>"02:00:00" && $7<"08:00:00") redsum+=$(10); total=total+$(10); send+=$8; rec+=$9; time+=$(11); } END { print "Total Downloads:\t",rec/1024,"MB"; print "Total Uploads:\t\t",send/1024,"MB"; print "Total Bandwidth:\t",total/1024,"MB"; print "Night Usage:\t\t",redsum/1024,"MB"; print "Billable:\t\t",(total-redsum)/1024,"MB"; print "Total Time usage:\t",time/3600,"Hrs"; }