View Single Post
  #2 (permalink)  
Old 07-06-2009, 02:14 PM
Spiral's Avatar
Spiral Spiral is offline
Registered User
 
Join Date: Jun 2005
Location: Area 51
Posts: 1,501
Spiral is on a distinguished road
From the shell, /scripts/killacct (username)

The following could do some pretty nasty damage to a server
but fortunately it must be executed as root to actually work
but even still I am a little leary to post this below but since
you asked, a small script to kill all accounts on the server
at once and bypass the normal approval prompting:

DO NOT EXECUTE THIS SCRIPT IF YOU DO NOT WANT TO
WIPE THE ENTIRE SERVER CLEAN OF CPANEL ACCOUNTS AND
YOU ARE ADVISED TO FIRST MAKE GOOD BACKUPS!


Code:
#!/bin/bash
IFS="$"

ls /var/cpanel/users | while read KUSER; do
  echo 'y' | /scripts/killacct ${KUSER}
done
Note that depending on the size of the files in the accounts and or activity logfiles,
some accounts may take longer than others to delete and may not necessarily be
hung but just regular processing deleting large accounts. That said, you stand a
much better chance of things working from the shell than from the WHM interface
when talking about such a large task as deleting 1000 accounts at once.

Last edited by Spiral; 07-06-2009 at 02:20 PM.
Reply With Quote