Home arrow Site Administration arrow Page 8 - File Synchronization With Rsync

Mirror, Mirror, On The Wall - Administration

Save time (and money) on data transfers between hosts withrsync, a synchronization tool that allows easy, efficient replication offiles between different locations. Sync up, now!

TABLE OF CONTENTS:
  1. File Synchronization With Rsync
  2. Getting The Skinny
  3. Building Blocks
  4. Temporary Insanity
  5. Remote Control
  6. Doing More
  7. What's In A Name?
  8. Mirror, Mirror, On The Wall
  9. Link Out
By: icarus, (c) Melonfire
Rating: starstarstarstarstar / 93
December 04, 2002

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
So that's the theory. Let's now see how I applied it to my original problem (in case you've forgotten, I needed to copy the contents of a directory on our staging server to a corresponding directory on our Web server).

Let's assume that the staging server is called "medusa", and the directory to be mirrored from it on to the live server is "/usr/local/apache/htdocs/beta". The first thing to do, obviously, was to set up rsync as a daemon on one of the hosts - say "medusa" - and configure it to make the "/usr/local/apache/htdocs/beta" directory available as a module.
[web]
path = /usr/local/apache/htdocs
comment = Web Server Root
list = yes
read only = yes
Next, I needed to log in to the other end of the connection - the live Web server - and run rsync to connect to the staging server and get the latest build released by the development team to "medusa".
[webmaster@domain] $ cd /www-root/
[webmaster@domain] $ rsync --compress --verbose --delete --links--recursive --perms medusa::web/beta .
In case you're wondering, the "--compress" option compresses the data while sending it, while the "--perms" option retains the original file permissions on the destination host.

I put the two lines above into a shell script, and set it to run on a daily basis via cron. Since rsync only sends the delta when performing a copy operation, my bandwidth usage was minimal...and since the process was now largely automated, I was able to get my social life back on track.

 
 
>>> More Site Administration Articles          >>> More By icarus, (c) Melonfire
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SITE ADMINISTRATION ARTICLES

- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: