The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

/var/cpanel/bandwith BUG ?

Discussion in 'Workarounds and Optimization' started by abdelhost77, Nov 27, 2013.

  1. abdelhost77

    abdelhost77 Well-Known Member

    Joined:
    Apr 25, 2012
    Messages:
    81
    Likes Received:
    1
    Trophy Points:
    8
    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 ?
     
  2. abdelhost77

    abdelhost77 Well-Known Member

    Joined:
    Apr 25, 2012
    Messages:
    81
    Likes Received:
    1
    Trophy Points:
    8
    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
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  4. Echelon17

    Echelon17 Well-Known Member

    Joined:
    May 21, 2006
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    6
    Why is cPanel not cleaning up after itself and removing this data after termination anyway??
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page