BASH Script:displays total download usage in specified time

Write tutorials and howtos in here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

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

Postby Habitual on Sun Aug 05, 2012 8:15 am

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.
What's a landing but a take off in reverse?
My DorkBlog
shellshock.conf for fail2ban 0.8.10
User avatar
Habitual
Level 8
Level 8
 
Posts: 2182
Joined: Sun Nov 21, 2010 8:31 pm
Location: LM17Q-Xfce

Linux Mint is funded by ads and donations.
 

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

Postby coonhunter on Sun Aug 05, 2012 8:49 am

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.
Last edited by coonhunter on Sun Aug 12, 2012 5:12 pm, edited 1 time in total.
coonhunter
Level 1
Level 1
 
Posts: 8
Joined: Thu Aug 25, 2011 4:26 pm

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

Postby Habitual on Sun Aug 05, 2012 8:55 am

Habitual wrote:...I will leave that up to you to figure out.
What's a landing but a take off in reverse?
My DorkBlog
shellshock.conf for fail2ban 0.8.10
User avatar
Habitual
Level 8
Level 8
 
Posts: 2182
Joined: Sun Nov 21, 2010 8:31 pm
Location: LM17Q-Xfce


Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 11 guests