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.

Where are the List Accounts quota stored

Discussion in 'General Discussion' started by gearheadhost, Aug 15, 2009.

  1. gearheadhost

    gearheadhost Member

    Joined:
    Jun 14, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    I have been trying to find the file that shows the disk usage that is listed in the List Accounts on and off for the last week. Basically I want to be able to cat or grep that file from within ssh without going to the WHM. I can work so much faster in ssh than in WHM and it would make things alot easier to do it that way.

    Also when a vps node goes over quota the list accounts seems to fail to list anything and I can't see where the big file usage is via that so I need ssh to do it and du takes forever.

    Any assistance is much appreciated.
     
  2. chinmay

    chinmay Well-Known Member

    Joined:
    Jul 22, 2008
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    localhost
    The quota file "quota_-v" is located at "/home/cPanel_username/.cpanel/datastore".

    Note :: Replace cPanel_username with actual username

    Hope this is what you were looking for ;)
     
  3. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    Run script /scripts/fixquotas. It will help to fix Cpanel when the user quotas aren't reading properly or showing unlimited for all user accounts.
     
  4. gearheadhost

    gearheadhost Member

    Joined:
    Jun 14, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    This is EXACTLY what I have been searching for... Now to write me up a little script so I can indes these over the entire server and things will be just super.

    Great help thank you.
     
  5. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The quota_-v file is not used by List Accounts. That file only gets updated when a user logs into the cPanel interface. If you have accounts that rarely login then the value in the quota_-v will be stale and inaccurate.

    List Accounts calls the quota command directly and parses the output for display.
     
  6. gearheadhost

    gearheadhost Member

    Joined:
    Jun 14, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Well that is better than the above... What is the quotas command that cPanel's list accounts uses? I'm not as much of a linux ninja as others.
     
  7. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    You could get it programmatically with this:

    perl -I/usr/local/cpanel -MCpanel::SysQuota -MData::Dumper -e "print Dumper(Cpanel::SysQuota::analyzerepquotadata())"
     
  8. gearheadhost

    gearheadhost Member

    Joined:
    Jun 14, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    End result accomplished...

    So it may be a little ghetto in the end but this is what I was trying to create in the end.

    http://www.gearheadhost.com/usage

    Code:
    mkdir /quotaRunner/
    
    echo "Getting the quotas... This could take some time"
    
    perl -I /usr/local/cpanel -MCpanel::SysQuota -MData::Dumper -e "print Dumper(Cpanel::SysQuota::analyzerepquotadata())" > /quotaRunner/quotas
    
    for users in `cat /etc/trueuserdomains | cut -f2 -d :`
    do
    grep -n $users /quotaRunner/quotas | head -1 >> /quotaRunner/lineNumbers
    done
    
    for quotas in `cat /quotaRunner/lineNumbers | cut -f1 -d :`
    do
    sed -n $quotas'p' /quotaRunner/quotas | cut -f1 -d ,
    done
    
    rm -rf /quotaRunner/
    
    If you want to run this on your server run
    wget http://www.gearheadhost.com/usage ; sh usage

    Many thanks to Kenneth and especially Nick. Without you two this would have first been built on old data (Kenneth ftw) and second would have never been completed (Nick ftw).
     
Loading...

Share This Page