-   Gentoo (
-   -   Newbie: What is "rsync"? (

snmcdonald 02-01-2013 03:22 PM

Newbie: What is "rsync"?
Coming from other distros such as Debian and Arch, I don't really understand the purpose of rsync. In other distros I select one (or a few [such as security updates]) mirror location and syncronize with the mirror location itself.

Why am I required to set a sync as well as a mirror server?

What is the difference between the GENTOO-MIRRORS and SYNC?

Why do other distros not offer an rsync option?




acid_kewpie 02-01-2013 04:22 PM

rsync is not in the slightest bit gentoo specific. You have rsync on EVERY distro out there. They just don't use it the way gentoo does.

rsync here is being used to mirror a location using the rsync transfer method instead of http or ftp. It's just another way to obtain local copies of files, but here it keeps them up to date more effectively as it will compare the two locations explicitly.

snmcdonald 02-01-2013 05:06 PM


Originally Posted by acid_kewpie (Post 4882560)
rsync is not in the slightest bit gentoo specific. You have rsync on EVERY distro out there. They just don't use it the way gentoo does.

You may have it available but it doesnt appear to be default in either Debian nor Arch.

So if rsync acts as a mirror why am I required to supply an http/ftp mirror as well as an rsync mirror?

acid_kewpie 02-01-2013 05:13 PM

As per the documentation - the mirror contains the source code (lots of data) the rsync contains the config scripts (less code)

You wouldn't want to rsync ALL the source packages, that'd suck!

frankbell 02-01-2013 11:06 PM

The rsync command has been included with every distro I've installed, including Debian, but just as a command that you could use or not use as fits your needs.

Its most common use, I think, is to back up stuff, usually to another computer or drive. That's how I use it, at least.

bloody 02-26-2013 04:29 PM

The rsync command is used to make one directory contain exactly the same than another directory, with a minimum of data transfer required, which is especially useful if the "template" (or "source") directory is located on an externel server in the internet.

rsync copies files you don't have, deletes files the other server does no longer have, and also checks if files have changed (using hashes) and updates your files accordingly. It's a fast & convenient method of synchronizing the contents of two given directories. So rsync is used to create a local 1:1 copy of the recent list of available packages to your machine.

The other "mirror" thing is not used together with rsync because you don't want to download all the tenthousands of software packages that are available for possible install. It only specifies a server address where you can download packages from, which is then used whenever you install [a] software package[s].

i92guboj 02-28-2013 06:50 AM

Mmm, it seems your concern is that Gentoo uses rsync instead of curl or wget... well, assume it, your neighbour probably has a different car, a different pet, and a different wife. It's the way life is :P

Being that said, let's clarify some things.

In first place, as said above, rsync has nothing to do with Gentoo. Gentoo uses rsync just like it uses gcc or glibc. Each distro picks whatever suits.

Secondly, there are two separate kinds of data at package manager level: the ebuilds which conform the portage tree on one side; and the source (and a few binary) packages on the other side.

Gentoo uses rsync for portage, which is kind-of the package database. But it also uses a plethora of other tools to fetch the actual packages. Most tarballs are downloaded using wget, but some ebuilds use other tools, even RCSs like svn, git, bazaar, cvs... It just depends on the nature of the package.

Note that in any case, wget can be changed for whatever suits you by setting $FETCHCOMMAND in make.conf. I don't recommend it, though.

Thirdly, you *don't need* to set neither the mirrors nor the rsync server. There are defaults. Maybe the handbook misguided you in that, I don't know. It's been years since I used it.

rsync just happens to be the most efficient way to keep in sync the portage tree using the minimum bandwidth and cutting drastically the sync times. An RCS like git could be used as well, but it would introduce lots of control files in the tree which is, in my opinion, an unnecessary overhead (and in any case would not bring any advantage over rsync).

If you feel that picky about using rsync for some obscure and mysterious reason, then just use whatever tool you prefer to reguarly download a portage snapshot, remove your old portage tree and uncompress the new one in the same location.

Other than that, is there any real problem that you are trying to solve?

snmcdonald 02-28-2013 05:09 PM

Thank you for all your posts. I am still confused about the GENTOO_MIRROR variable.


A second important setting is the SYNC setting in make.conf. This variable contains the rsync server you want to use when updating your Portage tree (the collection of ebuilds, scripts containing all the information Portage needs to download and install software).

Is SYNC for synchronizing the portage database and GENTOO_MIRROR for downloading the actual packages.

Is this a rough equivalent?

SYNC ~= aptitude update (SYNC would be where the package manager goes to update the package database)
GENTOO_MIRROR ~= aptitude get <software> (GENTOO_MIRROR would be where the package manager goes to get the actual package)

i92guboj 03-01-2013 04:07 AM

Yes. You can actually just paste the url into a browser and take a look to see what it contains ;)

snmcdonald 03-01-2013 12:24 PM


Originally Posted by i92guboj (Post 4902254)
Yes. You can actually just paste the url into a browser and take a look to see what it contains ;)

Interesting. Thank you. At first I thought it was redundant to separate the list from the software, but on second thought its nice to have a finer control.

All times are GMT -5. The time now is 04:19 PM.