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.

How to mass terminate accounts??

Discussion in 'General Discussion' started by Juliet, Apr 26, 2003.

  1. Juliet

    Juliet Member

    Joined:
    Feb 18, 2002
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi, i need to terminate every single domain on my coanel dedicated server. I have 600 domains on it so it would take waaaay to long to delete each account manually.

    I tried searching but came up with nothing... does anyone know the best way i can delete every single account on my server. I need to delete all of them a.s.a.p
    Maybe do it via SSH somehow?

    Thanks :confused:
     
  2. SoftmegUK

    SoftmegUK Well-Known Member

    Joined:
    Feb 13, 2002
    Messages:
    372
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    UK
    Use the Accounting functions put all the accounts usernames in a array then for each value in the array make it termanate it.

    If you get what I mean....

    Hope this helps....
     
  3. kipper3d

    kipper3d Well-Known Member

    Joined:
    Jul 14, 2002
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    I dont understand. How do you terminate all accounts??

    -John

    cPanel.net Support Ticket Number:
     
  4. SoftmegUK

    SoftmegUK Well-Known Member

    Joined:
    Feb 13, 2002
    Messages:
    372
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    UK
    To easily mass termanate accounts you should use either the Perl Account Module or the PHP Module and get a list of all the accounts, put them in an array and write a script to delete them all.

    cPanel.net Support Ticket Number:
     
  5. dysk

    dysk Well-Known Member

    Joined:
    Apr 22, 2003
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    Hi-
    Another quick way of terminating many accounts is with /scripts/killacct <username> y (assuming that you also want to remove that user's named entries, otherwise replace the y with an n)
    You can write a perl or shell script that goes through and runs that command for each user you want to delete.
    Maybe something like:
    #!/usr/bin/perl
    @userstodie = ('joe', 'bob', 'jim');
    foreach $user (@userstodie) {
    `/scripts/killacct $user y`;
    }
    A slightly more complicated program could look in the cpanel users files and delete all the users. Hint, there's a file for every cpanel user in: /var/cpanel/users, a simple opendir() would go a long way.

    Good Luck,
    Erek Dyskant
    Unix Consultant

    cPanel.net Support Ticket Number:
     
  6. clanosiris

    clanosiris Member
    PartnerNOC

    Joined:
    Aug 10, 2004
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    what about deleting accounts that have 0.0 MB disk/ 0.0 MB bandwidth. like a script that goes through bandwidth usage and deletes account that have no bandwidth usage>..
     
  7. adept2003

    adept2003 Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    283
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    ~ "/(extra|special)/data"
    Unless you're offering free hosting, then why on earth would you want to do that? The number of times we have to run ./scripts/fixquotas etc, you may find the script deleting accounts you didn't want it to.
     
Loading...

Share This Page