Content replication with rsync and SSH

From CobaltFAQs

Jump to: navigation, search

THIS IS A DRAFT PROCEDURE -- USE WITH CAUTION!

You will need root logins enabled for this script to work, and you will need to enable public key authentication as well (and generate the keys). man ssh (once it's installed) for more info, or visit http://www.openssh.com/


Install OpenSSH on each RaQ (a free PKG is available at http://www.solarspeed.net/ and other places online as well)

Install rsync on each RaQ.

Create /etc/rsyncd.conf on the "source" server (man rsyncd.conf for info). Includes defining file source directories, etc.

Start rsync in daemon mode on the "source" server (where you're copying from)

 rsync --daemon

Start an rsync process on the "destination" server (where you're copying to)

 rsync -e ssh -a source_server::named_source_dir/ /home/sites/home/web/

This command manually mirrors the contents of the source server directory tree named_source_dir in /etc/rsyncd.conf to the /home/sites/home/web/ directory on the destination server (where you're running the command from).

Put this command in a cron job to run automatically every day, etc.

Personal tools