eSupun
New Member
cPanel Inactive Account Removers
I am contributing to FWS after few months. Hope this will be useful for free web hosting owners.
I thought I might distribute this cPanel Inactive Account Remover which I developed in order to obtain more room for active free web hosting users.
More information can be found in here: http://perfectz.info/blog/inactive-accounts-remover-for-cpanel-servers/
Installation
Make a backup of every account in the server in case it deletes active accounts by mistake.
Download the script.
http://perfectz.info/inactive-accounts-remover.tar.gz
Modify the config.php according to your settings. The config.php have the following variables which need to be changed.
PHP:
$ipaddress = "192.168.0.1"; //Servers IP Address
$host = "hostname.example.com"; //Hostname
$whmuser = "root"; //Username which has permissions to grab and delete user accounts
$whmkey = ""; //WHM Remote Access Key
$db_host = "";
$db_name = "";
$db_user = "";
$db_passwd = "";
$date = 1330560000; //Date in Unix format
This $date variable is used to identify the new accounts in the server.
Some people just don't upload data or forward their domain right after they register with you. In that case it is a good practice to keep this to a date before 2 weeks or back. That's up to you. Remember to convert date to unix date format before you use it. Use http://www.onlineconversion.com/unix_time.htm
Eg: If you want to delete the inactive accounts created before 1st of May,2012, you will have the unix date as 1335830400.
Log into your server and upload all the files including config.php which you just modified.
*Remember not to upload the scripts to publicly accessible place. Upload it to somewhere else.
Eg:/usr/local/src/
Make the scripts executable.
Code:
chmod +x delete.php listaccts.php whm.php
Run whm.php and set output into a file.
Code:
php whm.php >> Output.html
The script itself has the functionality to fetch user account data from a cPanel server and delete inactive accounts automatically. This script uses JSON to fetch data and a point system to detect which accounts are to be deleted.
You can contribute in various ways. I will have my pleasure even though you don't.
Comments and feedback is highly appreciated.
Last edited: