Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We're getting ready to light up another data center and we have a local administrative machine that scripts aim backups at.

We'd like the backup directory on that machine to bidirectionally sync with a machine in our primary data center so the same backups are seen on all the admin machines.

Any suggestions folks?

share|improve this question
    
I think that question is strange, how is biderictional syncing a requirement for "seeing it on all admin machines"? –  Server Horror Jun 29 '09 at 21:02
    
I agree, I think further clarification is needed to answer this correctly. Do you mean that all your hosts backup to this admin server and you want all that data then synchronised to another admin server in a different datacenter, but that admin server also has other servers pointing backups at it? –  Brendan Jun 29 '09 at 23:54
    
One directory is kept in sync between multiple hosts on those hosts. I guess I'm describing dropbox... short of having a centralized server. –  Nathan Milford Jun 30 '09 at 4:20
add comment

3 Answers

up vote 3 down vote accepted

you can check unison. i was thinking about using it but [ maybe fortunately ] at the end i convinced people in charge that it's recipe for disaster, we ended up with master-slave setup and one way synchronization.

share|improve this answer
    
Why do you think it is a recipe for disaster? Or why was it going to be a bad idea for you? –  Zoredache Jun 29 '09 at 22:28
    
in my case there ware dependencies between files, sync of some while conflicting file would be left untouched would lead to inconsistencies. surly that depends on type of data one wants to sync. –  pQd Jun 29 '09 at 22:47
add comment
rsync -e ssh --update /backup/dir remote:/backup/dir
rsync -e ssh --update remote:/backup/dir /backup/dir

The --update option makes it skip newer files; so you'll always get the newest copy on both ends.

(this assumes timestamps in your original backup to the admin machine preserves timestamps properly)

share|improve this answer
1  
rsync is the cannonical answer for UNIX sync –  pcapademic Jun 29 '09 at 21:13
add comment

This depends on how the files you're syncing are used. If individual files will possibly be updated in both locations,it will be difficult for your process to determine which version is the "correct" one, even if you just go with whichever edit was newer, you could wind up overwriting someone's legit changes. This same situation arises for the deletion of files. In either one of these cases, you would be better of doing proper version control rather than syncing.

If, on the other hand, the files will always be written in one location, and just need to be accessible for read only use in the other location, you're better off doing two one-way syncs using rsync or something similar, and keeping the files separated.

share|improve this answer
add comment

Your Answer

 
discard

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.