Joined: 18 Apr 2004
Location: New York, USA
|Posted: Thu Jun 03, 2004 7:09 pm Post subject: Rsyncing between computers on a LAN
|Rsyncing between computers on a LAN
Ok, here's my situation...
I have a Gentoo Web Server. I have a computer (this one im on aka the host) that dual boots between Gentoo, Windows and Slackware (minimal flames please ). I do my webpage design in Dreamweaver under Windows and I used ftp for updating my webpages to the Gentoo Web Server using FileZilla. But, that process was a pain in the rear end bigtime...
I figured hey, it works with emerge so why not this, ya know? So anyways, here's how I went about getting it up and running to sync my website (and portage while im at it).
Step 1: First off, you need to install rsync on the computer that you would like to be the host for syncing.
NOTE: the =rsync is important!! Else emerge will sync with a public server via the internet as opposed to installling the rsync daemon
Step 2: Now, simply open up the config file like so... (I like nano, so I used nano)
|nano -w /etc/rsync/rsyncd.conf |
my config file looks like this...
|# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/net-misc/rsync/files/rsyncd.conf,v 1.2 2004/05/02 22:45:02 mholzer Exp $
# Minimal configuration file for rsync daemon
# See rsync(1) and rsyncd.conf(5) man pages for help
# This line is required by the /etc/init.d/rsyncd script
pid file = /var/run/rsyncd.pid
# this section is for syncing my website to my Gentoo Web Server from my Gentoo desktop (aka the host)
comment = my website
uid = pankey # its easier then adding the user into the rsync command
gid = nobody
exclude = hits # I have a php file called hits that acts as a hit counter but I do NOT want to overwrite this
comment = portage
uid = nobody
gid = nobody
exclude = distfiles # keep this unless you want to share all the tarballs between the pc's
This config accomplishes the syncing of portage and my website, without the headache of using ftp and overwriting only certain files, bla bla bla
Step 3: start the rsyncd daemon
|/etc/init.d/rsyncd start |
Optionally, you can add rsync to the default run level like so
|rc-update add rsync default |
Step 4: Leave this computer (the host) and log into the other computer (the client). In my case, my server is in a corner with a power cable and a network cable. So I ssh into the server and make my changes. Now, if you want to sync up the portage tree's, just type in
|rsync -uv rsync://<ip-address_or_hostname>/portage /usr/portage |
for example, i use
|rsync -uv rsync://192.168.1.100/portage /usr/portage |
Basically, your telling rsync to compare portage on the host (from [portage] section in the config file) to /usr/portage on the local machine and update (-u) as needed.
And for my website, iI would do
|rsync -uv rsync://192.168.1.100/mysite /var/www/localhost/htdocs |
Hope this helps...Any comments, suggestions or additions? Let me know.
Also, if you would like to see a more secure way to do this with ip allow's and deny's, check out this post by "flybynite"
LOVE THE CHICKEN!!!11one!
Last edited by pankey on Thu Jun 03, 2004 9:20 pm; edited 1 time in total