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 create 10000 accounts simultaneously and tranfer them to another server

Discussion in 'General Discussion' started by mojamoi, Jan 2, 2008.

  1. mojamoi

    mojamoi Well-Known Member

    Joined:
    Jul 23, 2007
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
    how to create 10000 accounts simultaneously and tranfer them to another server using shell command
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Code:
    #!/bin/bash
    for a in `seq 1 10000`; do
        /scripts/wwwacct domain$a.com user$a password
        /scripts/pkgacct user$a
        scp /home/cpmove-user$a.tar.gz user@remove.server:~
    ; done
    
    Not guaranteed to work.
     
  3. mojamoi

    mojamoi Well-Known Member

    Joined:
    Jul 23, 2007
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
    is there another way withour the for loop

    via shell command
     
  4. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    Yes, you can run the commands mentioned by cpanelkenneth 10000 times :)
     
  5. mojamoi

    mojamoi Well-Known Member

    Joined:
    Jul 23, 2007
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
    thanks alot guys....:)


    it does work using a for loop....


    is there any alternate way via shell script?
     
  6. mojamoi

    mojamoi Well-Known Member

    Joined:
    Jul 23, 2007
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
    let me know how to make package of 1000 accounts at one server and how to restore at

    let me know how to make package of 1000 accounts at one server and how to restore at another server
     
  7. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    wasn't this already answered in another thread?
     
  8. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    1. Craft a perl script using WWW::Mechanize to interact with the Create Account form in WHM

    2. Create a shell script that uses a combination of lynx (or other text mode browser) and the XML-API (http://www.cpanel.net/plugins/xmlapi/)
     
  9. rpmws

    rpmws Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    1,824
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    back woods of NC, USA
    can I ask why you would want to do this?
     
  10. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Agreed, this seems to be a duplicate of this thread: http://forums.cpanel.net/showthread.php?t=74606 with exception of that thread was for 10,000 accounts rather than 1,000 accounts. The same methods would apply though - just change any reference to 10,000 to 1,000.
     
  11. mojamoi

    mojamoi Well-Known Member

    Joined:
    Jul 23, 2007
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
    yes got some good replies via another thread....

    but can u help me with the script used in WHM for doing bulk account transfer?:confused:
     
  12. mojamoi

    mojamoi Well-Known Member

    Joined:
    Jul 23, 2007
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
    for better performance!!!

    my superior requires me use better method?

    do u have the WHM script for bulk account transfer?
     
  13. mojamoi

    mojamoi Well-Known Member

    Joined:
    Jul 23, 2007
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
    for better performance!!!



    do u have the WHM script for bulk account transfer?
     
  14. -jdk-

    -jdk- Well-Known Member

    Joined:
    Aug 28, 2005
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Just put the information in a shell script and then call the script :)
     
  15. mojamoi

    mojamoi Well-Known Member

    Joined:
    Jul 23, 2007
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
    help more

    1. Craft a perl script using WWW::Mechanize to interact with the Create Account form in WHM


    pls help me ..can u craft the script and give me?
     
  16. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    If you copy the for loop given above into a file, you can run it as a shell script. A shell script, at it's simplest, is just a sequence of commands you'd type to a root prompt put in a file.

    You're going to need to do some reading here, this isn't a forum for teaching you the basics if you're unwilling to do that. Do some googling for unix primers or unix tutorials and spend some time studying them.

    Also, your original request really doesn't make sense. It's ridiculous to make 10000 accounts on a server, then transfer them; it would make much more sense to create them on the new server. If we had some idea what you're actually trying to do we could probably give you better advice, but at the moment what you're asking for help with is going to cause you pain down the track, it's just not the right way to do it.

    Also, if you're making 10000 accounts you normally need to know the domain name for the accounts, unless you want it to be a dummy domain name.

    Sounds like you should get a book on WHM like the Packt book, available on Amazon.
     
  17. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Bulk transfer? Have you looked at WHM, as it does provide that functionality if you have root access. If you don't have root access, your server administrator may be willing to do the copies for you. If you were to search these forums you will find lots of information on how to do bulk transfers.

    My comments in the other thread about putting in some effort to understand the answers you are given apply here too!
     
  18. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    What is the problem you are attempting to solve?

    Why must you create 10,000 accounts on one server, then transfer them to another server?
     
  19. BianchiDude

    BianchiDude Well-Known Member
    PartnerNOC

    Joined:
    Jul 2, 2005
    Messages:
    619
    Likes Received:
    0
    Trophy Points:
    16
    You seriously put 10,000 accounts on a server? No wonder you need to move them to a faster server.

    A better idea would be to put them on 2 or more servers.
     
  20. mojamoi

    mojamoi Well-Known Member

    Joined:
    Jul 23, 2007
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
    pls craft this script to add and restore 1000 accounts on cpanel serevrs

    #!/usr/bin/perl -w

    use strict;
    use WWW::Mechanize;
    use MIME:ase64;

    my $mech = WWW::Mechanize->new( autocheck => 1 );
    my @args = (
    Authorization => "Basic " .
    MIME:ase64::encode( 'user' . ':' . 'pass' )
    );

    $mech->credentials( 'http://hosting.com:5555', 'cPanel', 'user', 'pass' );
    $mech->get( 'http://hosting.com:5555', @args );
    $mech->follow_link( text => 'Addon Domains', n=> 1 );
     
Loading...

Share This Page