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.

SCRIPT - Suspend accounts with 0MB space used

Discussion in 'General Discussion' started by jmginer, Oct 15, 2007.

  1. jmginer

    jmginer Well-Known Member

    Joined:
    Jul 26, 2006
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Benifato, Spain
    (Excuse my english)

    Hello, i'm interested to create an script to suspend or terminate an account if the account it's not in use. For example, if the account has 0MB space used.

    Can any help me??
    Thanks
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    In the XML-API there is a listaccts function that will list the disk usage for every user as well as other data. You can then process this XML and call either of the following XML-API functions: suspendacct (to suspend an account) or removeacct (to terminate an account).

    Documentation for all of this is available at: http://www.cpanel.net/plugins/xmlapi
     
  3. VISL

    VISL Member

    Joined:
    Jul 14, 2007
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    This would be very handy, in the list accounts function, is the 0MB disk space correct or could there be say 200k of data in an account??
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    There could be a few k of data in the account. I have a test account that has about 10k of data in it and it still reads as 0 MB used in WHM (which counts all files owned by the user) and 0.00 MB used in cPanel (all the files owned by the user in /home/user). The XML-API is designed to emulate the functionality of WHM rather than cPanel itself, so expect it to return the number WHM would return rather than cPanel.
     
  5. VISL

    VISL Member

    Joined:
    Jul 14, 2007
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Is there anyway at all to clean out unused accounts? Even outside WHM/CPanel??
     
Loading...

Share This Page