Bandwidth reset (but maintain current month usage)

Protollix

Verified User
Joined
Apr 24, 2004
Messages
59
It seems DA decided not to reset usage/tallies at the beginning of this month and now I am getting a ton of emails from customers who are mad they are going over the b/w limit already.

I have searched the forums, and all threads seem to say how to reset the current tally to 0. Well that's nice and all, but we are 8.5 days into the month.

Is there a way to "correct" (not totally reset) bandwidth/usage, such that, the proper usage for this month is recorded?

I was in the middle of writing a script to do this, but I wanted to see if there is already a way to do so. It would make things so much easier.

I really don't want to reset everyone's usage to "0" for this month!
 
There is no ready way to do this that I know of. I'm afraid your custom script is going to be the way to go.

Are your nightly tallies working? You might want to make sure your contab is setup correctly with the monthly reset command.
 
No, I have never had a monthly cron that runs. I just checked another server that *did* run the reset command at the beginning of this month and there is no cron entry (in user cron spool files, or the crontab in /etc or the cron dirs in /etc) that performs this command.

I thought Directadmin handled this automatically with it's normal nightly processing (as in, if it's the 1st or last day or whatever, rotate everything out)?
 
It does, but the commands are initialised by a cron job. Is bandwidth tallied and webalizer logs updated nightly for you? If so then there is a crontab somewhere which is running the commands.

For example, they are located in /etc/cron.d/directadmin_cron for me on Debian.
 
ahh yes. that file is there for me on Redhat and it indeed does include jobs for tallying and resetting.... The reset is set to run at 4:20am on the 1st of each month.
 
Hello,

As of several releases ago (like.. 6 months) we started including the time of the nightly tally. With that info I shoud be able to create a script that surgically takes out the previous months data without toasting the current data. I'll create a task.queue command that just does this for the bandwidth.tally files for all users. Then the nightly tally can recount everything for the correct reseller stats, etc, later on (with a seperate call).

Added to versions system.
http://www.directadmin.com/features.php?id=618

John
 
Back
Top