Local rsync mirror
rsync is a method of synchronizing one machine against another to ensure the files are consistent and updated when necessary. This is not the same as a cp function as files will be skipped if they are determined to be current. Local rsync'ing is much faster than synchronizing every machine against official Gentoo rsync mirrors, and it will reduce the load on those mirrors.
Contents |
[edit] Installing
To preapre the server we need the rsync tool. It should be in the system by default, but if it is not then you will need to emerge it:
[edit] Configuring
The file used to configure Rsync is /etc/rsyncd.conf. It should have the settings required to setup your own local Rsync for the Portage tree. Find the lines in the example below and uncomment them:
[gentoo-portage]
path = /usr/portage
comment = Gentoo Portage tree
exclude = /distfiles /packages
Now you will need to start the server:
To have rsync start at boot:
[edit] Configuring client
The local rsync server should be working, but before you will start syncing you will need to edit /etc/make.conf on your client machines by adding or changing the SYNC variable:
SYNC="rsync://192.168.1.2/gentoo-portage"
Change 192.168.1.2 to the proper IP address of your server. Additionally, you can only specify one mirror to synchronize against.
[edit] Opening rsync port on firewalled systems (iptables)
rsync handles communications through TCP port 873. If you are firewalled you will need to open the port by adding following line to your firewall script:
Not so obviously, change eth0 to the proper device that connects to your network.