SCRIPT - Suspend accounts with 0MB space used

jmginer

Well-Known Member
Jul 26, 2006
150
4
168
Alicante
cPanel Access Level
Root Administrator
(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
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
(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
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
 

VISL

Member
Jul 14, 2007
12
0
51
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??
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
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??
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.
 

VISL

Member
Jul 14, 2007
12
0
51
Is there anyway at all to clean out unused accounts? Even outside WHM/CPanel??