LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Which tool to track scheduled download quota (https://www.linuxquestions.org/questions/linux-networking-3/which-tool-to-track-scheduled-download-quota-821944/)

Subbass 07-24-2010 04:31 PM

Which tool to track scheduled download quota
 
My ISP has implemented a download quota between the "peak" hours of 8am and midnight. It is restricted to 100GB over a rolling 30days.

I would like to track peak and off peak if possible, but only peak is really necessary.

Prior to the limits in certain hours I was using VnStat with a couple of home made scripts to log usage and calculate the rolling 30 days total. I don't really know how to tackle changing it to log only limited hours and am fairly certain my scripting skills just aren't up to it.

Is there another tool that can do what I need, I would very much prefer a console based solution. If it is console and only handles peak and off peak then I can try and script for the 30days again.

Or has anyone managed to script something like this parsing from VnStat already ?

Thanks in advance.

unSpawn 07-24-2010 05:40 PM

Quote:

Originally Posted by Subbass (Post 4044250)
I don't really know how to tackle changing it to log only limited hours

Vnstat uses a cronjob to log traffic stats so you would only change the hours ("*/5 8-0 * * *") to make it run between 8 AM and midnight.

Subbass 07-24-2010 06:43 PM

Quote:

Originally Posted by unSpawn (Post 4044307)
Vnstat uses a cronjob to log traffic stats so you would only change the hours ("*/5 8-0 * * *") to make it run between 8 AM and midnight.

Thanks for your reply.

I am using the latest version of VnStat which I believe uses a daemon rather than cron entry. I'm unsure of how to configure that to only run at the needed times, I did try reading "man vnstatd" without success.

unSpawn 07-25-2010 12:56 PM

You could create a cronjob to stop vnstatd at midnight and start it at 8 AM.

Subbass 07-25-2010 01:13 PM

Quote:

Originally Posted by unSpawn (Post 4044918)
You could create a cronjob to stop vnstatd at midnight and start it at 8 AM.

I thought about that but vnstat needs to be run as sudo to --disable and --enable.

I'm not sure if adding a cron to root would work, I assume so ?

Could I achieve that by doing a "sudo su" then adding them "crontab -e" and add it that way ?

I am on Ubuntu 10.04 and haven't fiddled with root crontab before.

Thank you again for your continued suggestions.


All times are GMT -5. The time now is 08:28 AM.