Bulk copy/paste of folders/sub folders/files

Discussion in 'Site & Server Administration' started by san321, Mar 20, 2011.

  1. #1
    Hi guys,
    I want to take a joomla installation on a hosting account on my server and replicate it 5-10000 times.
    So take the public_html folder and all files and folders under it, and copy/paste it to folders that I name eg public_html/a/copy1, public_html/a/copy2 and so on and so on.

    The database replication of joomla installs etc I have under control, at this stage I just wish to bulk copy/paste and control the folder name I paste the install to.

    (folder names will be based on the end site name hence why I need to control it).

    Is there a WHM plugin or root/shell script that can do this? Any ideas on how to go about it?

    Is there a php function that can do this?

    Thanks
     
    san321, Mar 20, 2011 IP
  2. rod.maqstuirt

    rod.maqstuirt Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    #!/bin/bash
    for n in {1..2}
    do
            cp -R public_html/a  "public_html/a_$n"
    done
    
    Code (markup):
    Hope this helps :)
     
    rod.maqstuirt, Mar 21, 2011 IP