Naveen Kumar (नवीन कुमार) (moebiuscurve) wrote,
Naveen Kumar (नवीन कुमार)

How I keep track of my bandwidth usage...

Since my current Internet Service Provider Reliance Communication has started cheating, I now keep an account of my bandwidth usage. Here's a script I use for every internet session:


date >>usage.txt
ifconfig ppp0|tail -n 2 >>usage.txt
ifconfig ppp0
if [ "$?" -ne "0" ]; then
cp usage.txt $( date | sed -e "s/://g" |sed -e "s/ //g").txt
rm usage.txt
sleep 180;
It takes a sample of usage every 3 minutes and when you are done, dumps your usage for the session in some file with name such as "SunFeb5044143IST2012.txt". Later you can grep, cut and sum all of your usage from all of the files for a particular period.

And if you are interested in some graph of your usage pattern, you cane even do that using some kind of regression or time series.

Other better ways are welcome.

  • A review of Battlestar Galactica

    Battlestar Galactica: An exodus journey of surviving Humans, post apocalyptic/Nuclear-war scenario. into space/cosmos, also surviving from Cylons (AI…

  • A small review of some math apps on Android

    Among the math apps, I can say MathStudio (very costly, but worth spending if you know how to use it) and MyScriptCalulator (No cost) are the best…

  • An ode to flattery...

    Our Lord's ears are great & it must be worshipped. There is but one truth, to worship his ears. The grooves, curves and the twists in his ears…

  • Post a new comment


    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded