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.

Synchronize 2 websites (1 direction A to B)

Discussion in 'General Discussion' started by psytanium, Aug 2, 2016.

  1. psytanium

    psytanium Well-Known Member

    Joined:
    Jun 6, 2014
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hi,

    website1.com and website2.com are located on the same vps server. I'm trying to make website2 look the same as website 1 with only 1 difference, another logo.

    is there a way to do it from cpanel tools or WHM ?

    thanks
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    669
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    You can copy the content of /home/$username/public_html to another account via SSH with a command such as:

    Code:
    cp -a /home/$username/public_html/* /home/$username2/public_html/
    Ensure you update the ownership of the files in the new account to the new account username using the "chown" command.

    The other option is to manually download the files via FTP from one account, then upload them to the new account via FTP.

    Thank you.
     
  3. psytanium

    psytanium Well-Known Member

    Joined:
    Jun 6, 2014
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Can I use this command line in Cron Job ?
    Can I add exceptions ? I need to copy all the content of public_html without except public_html/images/logo.png
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    669
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You could setup a cron job with a custom "rsync" command if you want to ensure files are copied to other locations on the system. Ensure you use the correct arguments for permission and ownership values so that files are owned by the correct user after copied to the new account. Here's a StackOverflow discussion on "rsync" that should help you get started:

    How do I copy a folder keeping owners and permissions intact?

    Thank you.
     
    psytanium likes this.
Loading...

Share This Page