abdelhost77

Well-Known Member
Apr 25, 2012
116
2
68
Morocco
cPanel Access Level
Root Administrator
Hello ,
i notice that /var consuming a lot of space disk , when i further check i found that /var/cpanel/bandwith taking 2G space !

and what is strange is that i found also data for terminated accounts , which abnormal i think !!

Is there any tips to fix that ? it is safe to remove this bandwidth file ? or rotate them ?
 

abdelhost77

Well-Known Member
Apr 25, 2012
116
2
68
Morocco
cPanel Access Level
Root Administrator
For example can i remove bandwith files that have not be updated during last 3 months trough the below command ? ( it will correspond to terminated accounts ? ) supposing that all active accounts in the server receive at least 1 hit in week ( which supposed be logged to bandwith file )

find -P /var/cpanel/bandwidth -mindepth 1 -maxdepth 1 -mtime '+90' | while read OLDFile; do
echo "Now deleting ${OLDFile} ..."
rm -f "${OLDFile}"
done
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

You can remove bandwidth data for terminated accounts if that data still exists, but I do not reccomend removing additional data associated with bandwidth.

Note that the following commands are helpful if you would like to symlink /var/cpanel/bandwidth to a partition (e.g. /home) with more disk space:

Code:
mkdir /home/bwtmp; tar -czvf /root/cp-bandwidth-backup.tar.gz /var/cpanel/bandwidth
mv /var/cpanel/bandwidth/* /home/bwtmp/; rm -rf /var/cpanel/bandwidth
ln -s /home/bwtmp /var/cpanel/bandwidth
Thank you.
 

Echelon17

Well-Known Member
May 21, 2006
73
0
156
Hello :)

You can remove bandwidth data for terminated accounts if that data still exists, but I do not reccomend removing additional data associated with bandwidth.
Why is cPanel not cleaning up after itself and removing this data after termination anyway??
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Why is cPanel not cleaning up after itself and removing this data after termination anyway??
I recommend opening a bug report if you can reproduce this behavior:

Submit A Bug Report

Please post the ticket number here so we can update this thread with the outcome.

Thank you.