Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Rsyncing between computers on a LAN
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
pankey
n00b
n00b


Joined: 18 Apr 2004
Posts: 22
Location: New York, USA

PostPosted: Thu Jun 03, 2004 7:09 pm    Post subject: Rsyncing between computers on a LAN Reply with quote

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 :roll: ). 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...

Solution...RSYNC!

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.
Code:
emerge -av =rsync

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)
Code:
nano -w /etc/rsync/rsyncd.conf

my config file looks like this...
Code:
# 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

[mysite]
        # this section is for syncing my website to my Gentoo Web Server from my Gentoo desktop (aka the host)
        path=/mnt/windows/website/
        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

[portage]
        path=/usr/portage
        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
Code:
/etc/init.d/rsyncd start

Optionally, you can add rsync to the default run level like so
Code:
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
Code:
rsync -uv rsync://<ip-address_or_hostname>/portage /usr/portage

for example, i use
Code:
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
Code:
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"
https://forums.gentoo.org/viewtopic.php?t=180336
_________________
LOVE THE CHICKEN!!!11one!


Last edited by pankey on Thu Jun 03, 2004 9:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
furkan
Guru
Guru


Joined: 11 Dec 2003
Posts: 520
Location: Montreal CA

PostPosted: Thu Jun 03, 2004 7:46 pm    Post subject: Reply with quote

it is an cool doc i was searching about this :)
_________________
DELL Inspiron 1501
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum