Introduction
On occasion you may find need to reset a user's bandwidth to 0 for a given month before that month has rolled over. The instructions provided here will allow you to reset a specific user to 0 for the month.
Procedure
First, move the file at /var/cpanel/bandwidth/cpaneluser.sqlite
aside :
mv -v /var/cpanel/bandwidth/cpaneluser.sqlite{,.bak}
This allows you to restore to the original usage should the need to do so arise.
Next, run the command /usr/local/cpanel/scripts/rebuild_bandwidthdb_root_cache
. This will process bandwidth for every user within the server and not just the user you wish to manage:
[root@test ~]# /scripts/rebuild_bandwidthdb_root_cache
Rebuilding bandwidth cache for this system’s 1 cPanel user(s):
cpaneluser … Done!
[root@test ~]#
Once completed you should have a new SQLite file for the user along with the old file:
[root@test ~]# ls -la /var/cpanel/bandwidth/
total 180
drwx--x--x 2 root wheel 52 Nov 27 03:40 .
drwx--x--x 103 root root 8192 Nov 27 03:43 ..
-rw-r----- 1 root domain 86016 Nov 27 03:40 cpaneluser.sqlite
-rw-r----- 1 root domain 86016 Nov 27 03:37 cpaneluser.sqlite.bak
[root@test ~]#
and you should see 0 bandwidth used for the account within the Bandwidth Usage interface in WHM