How to synchronize different account on the same server ? rsync ?

Discussion in 'Site & Server Administration' started by fattwam, Apr 22, 2012.

  1. #1
    Hello everyone,

    I have multiple cpanel account's running different websites that are identical.
    My question is how can i update an entire network of over 100 different account's to sync up with an account i have the updated on ?
    Each account is on the same server with just a different directory "/home/site1", "home/site2" etc...

    Now i have an account that i would like to copy from, its the account i do the actual work/updated on without fear of disturbing the entire network of sites.
    But after im happy with my changes i want to be able to push the changed live and have all the other account sync up with my updated one.
    All the sites are the same, no databases or anything complex just php/html files.

    I've been looking and found rsync but not sure how to properly or if i can use it to accomplish what im attempting to do.

    Say i want to update "home/site1/public_html" to be the same as "/home/UPDATES/public_html"
    Can this be done through rsync with the following ?

    rsync -av /home/UPDATES/public_html /home/site1/public_html
    Code (markup):
    Will this over right everything currently in site1/public_html with everything in updated/public_html ?
    Also i did a test and i could not seem to achieve the results i was after.

    For testing proposes i tried something simple, made an account and 2 new folders under public_html (/folder1 & /folder2). I placed an html file in folder 1 then issued the following command
    rsync -av /home/accountname/public_html/1 /home/accountname/public_html/2
    Code (markup):
    In hopes it would copy the contents of folder 1 to folder 2 but it did not.

    Hens why im coming here for help as im not sure if im doing it properly, or it can be done with rsync.
    Server is running CentOS with cPanel 11.32
    Also it's not an option to run all the sites off of 1 account as parked domains.

    Thanks for reading and any help
    Twam
     
    fattwam, Apr 22, 2012 IP
  2. tom.jeraldino

    tom.jeraldino Active Member

    Messages:
    1,761
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    53
    #2
    Have heard of 4Sync only, not rsync... Are you a founder?
     
    tom.jeraldino, Apr 24, 2012 IP
  3. fattwam

    fattwam Well-Known Member

    Messages:
    230
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Hey,

    Thanks for the reply, but im talking about rsync here the wiki article for reference Wiki Rsync
    Unfortunately 4Sync will not work.

    Thanks again
    Twam
     
    fattwam, Apr 24, 2012 IP
  4. cPAce

    cPAce Peon

    Messages:
    445
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    rsync is a lot more popular then 4sync. For what your trying to do, yes you can sync them by using rsync.
     
    cPAce, Apr 24, 2012 IP
  5. PK-Host

    PK-Host Guest

    Messages:
    109
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #5
    RSync should be able to help you here as long as your have SSH access.
     
    PK-Host, Apr 25, 2012 IP
  6. tom.jeraldino

    tom.jeraldino Active Member

    Messages:
    1,761
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    53
    #6
    Hmmm, tried it on my PC now, it is working pretty well)) can't complain really
     
    tom.jeraldino, Apr 25, 2012 IP
  7. tom.jeraldino

    tom.jeraldino Active Member

    Messages:
    1,761
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    53
    #7
    I would argue that, but the specifics of the services is a bit different
     
    tom.jeraldino, Apr 25, 2012 IP
  8. raindog308

    raindog308 Greenhorn

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #8
    rsync is a technology, not a company/service.

    Yes, you can use rsync to synchronize two directories on two hosts - that's its mission.

    You might also look at rsnapshot to provide versioning.
     
    raindog308, Apr 25, 2012 IP
  9. tom.jeraldino

    tom.jeraldino Active Member

    Messages:
    1,761
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    53
    #9
    well, that what I actually meant as well. Just haven't heard about it before, so just wondered if I got it right, that you weren't talking about 4Sync
     
    tom.jeraldino, Apr 26, 2012 IP
  10. fattwam

    fattwam Well-Known Member

    Messages:
    230
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    110
    #10
    Found the fix to this problem, i just didn;t have a trailing / in the source directory.

    you need to use / at the end of the source dir if anyone made this mistake as well.
    rsync -av /home/accountname/public_html/1/ /home/accountname/public_html/2
     
    fattwam, Apr 26, 2012 IP