Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    2

    Question How do I delete inactive accounts?

    Hello,

    I have three free hostings and need a script to delete dormant accounts.

    Dormant accounts as I believe that the sites did not generate any traffic, or who did not send any content

    There are already thousands of accounts

    Somebody could help me?

  2. #2
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jul 2005
    Location
    New Jersey, USA
    Posts
    397

    Default

    You can use the Terminate Multiple Account link in whm

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    2

    Default

    Quote Originally Posted by PlatinumServerM View Post
    You can use the Terminate Multiple Account link in whm
    There are Many accounts and the section does not appear that such accounts are inactive

    I need a script, preferably in PHP to do this task automatically

  4. #4
    Member
    Join Date
    Jul 2006
    Posts
    90

    Default

    Quote Originally Posted by gedan View Post
    There are Many accounts and the section does not appear that such accounts are inactive

    I need a script, preferably in PHP to do this task automatically
    You could check this script: "chkcpaccts" at:
    cplicensing dot net slash scripts.php

    This should help you track down inactive domains and then erasing them.

    Lehel,

  5. #5
    Member pratapsingh's Avatar
    Join Date
    Mar 2009
    Posts
    39

    Smile

    You can run this script on your risk please verify the outputs before deleting the accounts.
    =======================================
    :>/root/backupfolders
    :>/root/existing_acctuser
    :>/root/inacctive_account

    ls /backup/cpbackup/weekly | cut -d"/" -f1>> /root/backupfolders
    ls /var/cpanel/users | cut -d"/" -f1 >> /root/existing_acctuser

    for i in `cat /root/backupfolders`;
    do
    count=`grep -c $i /root/existing_acctuser`
    if [ $count == 0 ]
    then
    echo "$i : $count is an inacctive account";
    echo "checking the accounits $i under userdomains $count `grep $i /etc/userdomains`";
    echo $i >> /root/inacctive_account
    fi;
    done

    echo "!!!!!!!!!! WARNING !!!!!!!!!!!!!"
    echo "Do you really want to delete the InAcctive Accounts then press y else any other Key?"
    echo "!!!!!!!!!! WARNING !!!!!!!!!!!!!"
    path="/backup/cpbackup/weekly"
    if [ $1 == y ]
    then
    for i in `cat /root/inacctive_account`;
    do
    echo "Deleting inactive account $i backup from the server"
    rm -rf $path/$i
    done
    fi;
    ======================================

    Same thing you can repeat on daily and monthly.

Similar Threads & Tags
Similar threads

  1. "Show Active and Inactive Accounts" Question
    By matty005 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-28-2006, 10:54 PM
  2. Show Active and Inactive Accounts
    By rip_curl in forum New User Questions
    Replies: 0
    Last Post: 02-14-2006, 11:36 PM
  3. How to delete inactive users???
    By dazerrackers in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 12-03-2004, 04:52 AM
  4. inactive accounts
    By webbhost in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 03-15-2004, 05:02 AM
  5. Can't delete email accounts
    By jezzzicuh in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-18-2003, 06:08 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube