Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are currently migrating our servers over to a new platform and I need to keep 2 directories over 15Gb each in sync while testing/migrating services over to our new platform.

I have thought of using rsync to keep them uptodate however this would take a long time and only be uptodate at the time of running and I need this to be in realtime or as close to as possible!

If anyone could help would be greatly appreciated!!

Notes: Our current system is running ubuntu and our new one is running centos 5.5

share|improve this question
What is the rate of change? – sciurus Apr 30 '11 at 2:07
up vote 1 down vote accepted

You could do this with a cronjob that ran rsync -av --delete /directory testing:/directory at a certain interval, say every hour. However, this would needlessly run sometime when there were no changes, and it if there were a lot of changes immediately after a run i tcould be nearly an hour until they were synced. A better solution might be to use lsyncd.

Lsyncd watches a local directory trees event monitor interface (inotify). It aggregates and combines events for a few seconds and then spawns one (or more) process(es) to synchronize the changes. By default this is rsync. Lsyncd is thus a light-weight live mirror solution that is comparatively easy to install not requiring new filesystems or blockdevices and does not hamper local filesystem performance.

share|improve this answer
lsyncd and rsync has worked amazingly well, thank you! – davidcollom May 3 '11 at 9:23

You can mount the productive stuff to your testing system, so you'll always have the current status. But keep in mind everything you change in your testing environment will affect the productive system too!

share|improve this answer

It depends on the type of systems you are using.

If you are running linux a simple Rsync can keep the production and testing in sync. There are also Rsync utilities for Windows as well but I dont know who good they are.

Do you need replication both ways or just one way?

share|improve this answer
He still said he's using ubuntu and centos. He also mentioned that rsync is no option.. – binfalse Apr 29 '11 at 20:10
@binfalse. Thanks. Rsync could be an option but I don't believe that it's the right one. Replication would be oneway. Production to testing. But must delete anything on testing that isn't in production. – davidcollom Apr 29 '11 at 21:10
"--delete This tells rsync to delete extraneous files from the receiving side (ones that aren't on the sending side), but only for the directories that are being synchronized." If too much data changes per hour for rsync to keep up with, it's still not workable, and your remaining options would all be to mount both testing and production from common NFS or similar storage. – Mike Renfro Apr 29 '11 at 21:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.