[RELEASE] Bandwidth Resetter

Protollix

Verified User
Joined
Apr 24, 2004
Messages
59
I wrote this little script yesterday after realizing DA didn't reset the bandwidth on one of our servers this month.

It's a php script. Edit it and change the $daPath variable to point to wherever you have DA installed. The default should work for most installations.

Currently, what it does is:
Reads the user's bandwidth.tally file, grabbing only the lines from this month and discarding everything else. It then re-writes the file.

Next, it sums up the bandwidth from the tally file and writes it to the user.usage file.

This does not currently write a user.history line and it does not correct the domain-specific bandwidth tallies.

usage
Code:
To only fix one user:
php /path/to/fix_bandwidth.php username

To fix all users:
php /path/to/fix_bandwidth.php

I am releasing this under the GPL. Use at your own risk and I am not liable for any damage, corrupt data, loss of life, etc associated with the usage of this script.

Copy of the GPL can be found here: http://www.gnu.org/licenses/gpl.txt
 

Attachments

  • fix_bandwidth.zip
    1.7 KB · Views: 367
Back
Top