Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOW-TO] Set up a gentoo rsync mirror using FC2.
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
will_in_wi
Tux's lil' helper
Tux's lil' helper


Joined: 04 Feb 2004
Posts: 117

PostPosted: Thu Jun 24, 2004 6:09 pm    Post subject: [HOW-TO] Set up a gentoo rsync mirror using FC2. Reply with quote

First, read the gentoo rsync mirror howto. Now, create a script in /usr/bin:
Code:
nano -w /usr/bin/rsync-gentoo-portage

That says:
Code:
#!/bin/bash

RSYNC="/usr/bin/rsync"
OPTS="--quiet --recursive --links --perms --times --devices --delete --timeout=$#Uncomment the following line only if you have been granted access to rsync1.us$#SRC="rsync://rsync1.us.gentoo.org/gentoo-portage"
#If you are waiting for access to our master mirror, select one of our mirrors $SRC="rsync://rsync.gentoo.org/gentoo-portage"
DST="/usr/portage"

echo "Started update at" `date`  >> $0.log 2>&1
logger -t rsync "re-rsyncing the gentoo-portage tree"
${RSYNC} ${OPTS} ${SRC} ${DST}  >> $0.log 2>&1

echo "End: "`date`  >> $0.log 2>&1
Then make the script executable:
Code:
chmod a+rx /usr/bin/rsync-gentoo-portage
Now create a script in /etc/init.d/:
Code:
nano -w /etc/init.d/Rsyncd
Code:
#!/bin/sh
# description: Gentoo RSYNC mirror
# chkconfig: 2345 99 00

case "$1" in
'start')
        /usr/bin/rsync --daemon --safe-links --timeout=300
        touch /var/lock/subsys/Rsyncd
        ;;
'stop')
        killall rsync
        rm -f /var/lock/subsys/Rsyncd
        ;;
*)
        echo "Usage: $0 { start | stop }"
        ;;
esac
exit 0
Again, make the script executable:
Code:
chmod a+rx /etc/init.d/Rsyncd
Now, run the rsync script:
Code:
rsync-gentoo-portage
and wait until it is done. Once it is done, you should have a portage tree in /usr/portage on the server. Now you should create a cron job, so that the tree is synced every night.

The server is now set up as a gentoo rsync server.

To set up the client, edit /etc/make.conf and find the line that says:
Code:
SYNC="rsync://whatever/gentoo-portage
and change it to:
Code:
SYNC="rsync://therserversipaddress/gentoo-portage"
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