Posts

Showing posts from October 1, 2010

How to sync data between 2 servers automatically

FROM http://www.howtomonster.com/2007/08/08/how-to-sync-data-between-2-servers-automatically/ How to sync data between 2 servers automatically Have you ever wanted to know how to easily synchronize the data between multiple servers automatically? In this article I’ll explain how to setup 2 Linux servers to automatically synchronize data between a specific directory on each server. To do this we will use rsync, ssh key authentication, and a cron job. Let’s call the 2 servers ‘SOURCESERVER’ and ‘DESTSERVER’ for SOURCESERVER = Source server (the server we’re connecting from to upload the data) DESTSERVER = Destination server (the server we’re connecting to receive the data) Part 1 - Setting up SSH key authentication First, we need to make sure the DESTSERVER has the ability to use key authentication enabled. Find your sshd configuration file (usually ‘/etc/ssh/sshd_config’) and enable the following options if they are not already set. RSAAuthentication yes PubkeyAuthent