Page 1 of 1

Re: BASH Script:displays total download usage in specified t

Posted: Sun Aug 05, 2012 8:15 am
by Habitual
This sums up net usage quite nicely by the hour...

Code: Select all

#!/bin/bash
echo "Tx (MiB) for this hour is" $(for i in `date +%H` ; do vnstat --dumpdb | \grep "h;$i" ; done | cut -c 17- | cut -d\; -f1)
echo "Rx (MiB) for this hour is" $(for i in `date +%H` ; do vnstat --dumpdb | \grep "h;$i" ; done | cut -c 17- | cut -d\; -f2)
You'll need to install something to make that work, I will leave that up to you to figure out.

Re: BASH Script:displays total download usage in specified t

Posted: Sun Aug 05, 2012 8:49 am
by kleinbottle
Habitual wrote:This sums up net usage quite nicely by the hour...

Code: Select all

#!/bin/bash
echo "Tx (MiB) for this hour is" $(for i in `date +%H` ; do vnstat --dumpdb | \grep "h;$i" ; done | cut -c 17- | cut -d\; -f1)
echo "Rx (MiB) for this hour is" $(for i in `date +%H` ; do vnstat --dumpdb | \grep "h;$i" ; done | cut -c 17- | cut -d\; -f2)
You'll need to install something to make that work, I will leave that up to you to figure out.

Re: BASH Script:displays total download usage in specified t

Posted: Sun Aug 05, 2012 8:55 am
by Habitual
Habitual wrote:...I will leave that up to you to figure out.