LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-26-2012, 01:35 PM   #1
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 173

Rep: Reputation: 22
Sync folders and sub-folders between two centos webservers


I hope this is the right Forum!

I have a CentOS 6.2 Webserver with several name-based Virtual sites. I cloned an exact copy of the server to a different VMware ESX host and gave it a different IP address, so if by any chance there is a problem with the webserver on say Host A, all I need to do is change the IP Address on Host B and restart and I should be able to get back online in minutes.

Now, because the content of the webservers and Forums change quite frequently, I need to keep Host B in sync with Host A.

From my bit of research, RSYNC seems to be the way forward. It looks fairly simple, BUT...

Like everything else there is always a bit missing.

1. Which machine should I set up as the RSync Server, Host A (the live site) or Host B (the backup site)?
2. Can I sync /var/www/* to /var/www/* on the Backup?
3. I guess I should do this over SSH?
4. I also guess I can setup a Cron job to sync the servers every night?

Am I on the right track here? Is there something I'm missing?
 
Old 03-26-2012, 01:50 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Yeah, sounds like you've got the hang of it. There's no client / server in rsync really, just the two locations to compare. You can get the same result wherever you run it from with reversed commands. Running it over SSH makes it even simpler, as there is no remote daemon to run at all, you'd just add "-e ssh" to the command. http://troy.jdmz.net/rsync/index.html

rsync is a perfectly good solution, but you might prefer something like subversion. It can seem like overkill, and does take a little setting up, but it makes for a really nice solution including version control, so you'll not lose any files going forwards if you delete and rsync by mistake.

Last edited by acid_kewpie; 03-26-2012 at 01:52 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Sync web folders with local folder lpallard Linux - Software 3 05-14-2010 03:24 PM
Sync a USB flash drive with HD folders, possible? Valandil Linux - General 9 03-14-2010 11:16 PM
Sync files not folders with rsync (non recursive) ehlers Linux - Software 7 03-11-2009 09:53 AM
Sync Mail-folders (IMAP) Baumi Linux - Networking 4 12-20-2005 04:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration