Results 1 to 8 of 8

Thread: How to copy one file to all subdomains at once?

  1. #1
    Member H4CK3R's Avatar
    Join Date
    Oct 2011
    Posts
    45
    cPanel/WHM Access Level

    Website Owner

    Default How to copy one file to all subdomains at once?

    Is it possible to copy one file to all my subdomains at once, i dont want to copy one by one, because it takes a lot of time (to 14 subdomains), so is there any way?
    If yes, then please let me know, otherwise please move it to feature request and think about it.
    Thanks.

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,611
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How to copy one file to all subdomains at once?

    You could use the following command to copy a file in /home/username/public_html to subdomains and addon domains on the same account:

    Code:
    for i in `grep --exclude="*.cache" documentroot /var/cpanel/userdata/username/* | cut -d: -d' ' -f2-` ;do cp -p /home/username/public_html/filename $i/ ;done
    Please replace username with the account's username and filename with the name of the file.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Member H4CK3R's Avatar
    Join Date
    Oct 2011
    Posts
    45
    cPanel/WHM Access Level

    Website Owner

    Default Re: How to copy one file to all subdomains at once?

    But how to use this command? Thanks anyways.

  4. #4
    Member
    Join Date
    Nov 2011
    Posts
    380
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How to copy one file to all subdomains at once?

    You would need shell access to execute this command. You can login to your account by ssh and execute this command.
    Please refer SSH/Shell Access for more details.

  5. #5
    Member linux7802's Avatar
    Join Date
    Dec 2007
    Posts
    232
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How to copy one file to all subdomains at once?

    You can use the command give by Tristan, if you are having the server root login details ...

  6. #6
    Member H4CK3R's Avatar
    Join Date
    Oct 2011
    Posts
    45
    cPanel/WHM Access Level

    Website Owner

    Default Re: How to copy one file to all subdomains at once?

    But, i cant find any SSH option in cpanel, may be because i am not a root admin....

  7. #7
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,611
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How to copy one file to all subdomains at once?

    Yes, you cannot do it without root access. You'll have to do it manually or one domain at a time in an FTP client. Otherwise, you could ask the root administrator of the machine to do it for you using the command provided.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  8. #8
    Member H4CK3R's Avatar
    Join Date
    Oct 2011
    Posts
    45
    cPanel/WHM Access Level

    Website Owner

    Default Re: How to copy one file to all subdomains at once?

    Thanks...

Similar Threads

  1. How To Copy File Between 2 Account
    By thecutecat in forum New User Questions
    Replies: 2
    Last Post: 01-21-2011, 04:16 AM
  2. SquirrelMail Error - Could not move/copy file. File not attached
    By smile in forum cPanel & WHM Discussions
    Replies: 16
    Last Post: 12-19-2009, 11:34 AM
  3. Copy a file with ssh
    By persianwhois in forum cPanel & WHM Discussions
    Replies: 5
    Last Post: 08-08-2007, 08:11 AM
  4. Copy an Account (from file)
    By coffee23 in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 11-28-2004, 05:33 AM
  5. Unsolved error - subdomains & valiases fail to copy
    By ankesen in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 07-22-2004, 09:33 AM