[nSLUG] rsync questions

Daniel Morrison draker at gmail.com
Wed Feb 23 05:14:28 AST 2011

On 23 February 2011 03:44, Mike Spencer <mspencer at tallships.ca> wrote:
> The Dan MacKay wrote:
> Dan> I *do* use the rsync server, because it (well, mine does) runs as
> Dan> root and can write files as root; so when I do a backup of files
> Dan> from one machine to another, they have correct owners,
> Dan> modification dates and permissions.
> The -a switch seems to be doing all of that that I need.  All files are
> owned by my primary username so maintaining owner is default.

You will get an non-fatal error message if rsync fails to set
ownership. This might happen, for example, if you are careless (who
isn't sometimes) and create a file in your home directory as root and
forget using chown to set the ownership appropriately. Redirecting the
output of rsync with '> /dev/null' will hide everything but errors;
this is especially useful if you run your rsync out of cron. If an
error occurs, you get email, otherwise not.

> Daniel Morrison <draker at gmail.com> added:
> dm> An rsync server is also faster than using rsync over ssh, as you
> dm> skip the encryption step. But you should do this only if you trust
> dm> your local network....Since you are using NFS, you must trust your
> dm> local network (right?)
> Faster would be good because my router is old and slow (retained
> because it has a parallel port for a print server).  As I write, rsync
> is reporting between 500 and 600kB/sec using ssh.

I perhaps spoke hastily. Whether it's faster or not depends a lot on
your computers. If either CPU is very slow, the encryption speed could
be the limiting factor, in which case what I said is correct. If
instead disk read/write speed is the bottleneck, then avoiding ssh may
not impact the speed at all. If your disk and CPU are within their
limits, then network bandwidth is the limit.

I'm not certain if the total bytes transferred increases significantly
when encrypting with ssh, but I was assume there is some overhead. If
you have leftover CPU, both ssh and rsync have a compression option
(-C and -z, respectively). Using both is probably a bad idea;
compressed data does not usually compress again. rsync suggests that
their compression is superior to "remote shell or transport"
compression, as it takes advantage of knowledge of the content.

So I would typically assume that running plain rsync to an rsync
server would be fastest (adding compression for future incrementals),
but checking the resource utilization of your own unique computer is
required to be sure.

600 kB/s is 5Mbps (megabits/s), which is slightly more than half the
maximum bandwidth of a 10Mbit link. If you're at 10 Mbit then this
might be about as fast as you can get. However almost all routers are
100 Mbit, in which case it seems abysmally slow. My old Pentium M
laptop with very slow drive achieves 4MB/s with ssh over the loopback
interface, and over 10MB/s without ssh (all local, no rsync server). A
100Mbit network could handle that easily.

It got slower when I turned on rsync compression -- I think largely
because an initial transfer doesn't benefit as much, and I was testing
with binary files.

Anyway, experiment a bit and see what happens.

> My LAN is probably secure. My net connection is dial-up, not through
> the same router that supports the LAN.  My wireless signal is only
> usable at 150' or less (I've tested it) without better than average
> antenna anyhow.  The nearest neighbor is way further than that. So
> snoopers will have to be close enough (say, parked conspicuously in my
> laneway) to risk my deployment of um.... analog countermeasures. :-)

You LAN is as secure as the weakest system on it. If you port forward
to your system from the Internet, make certain that whatever service
is accessible is properly secured. WPA encryption for the wireless is
also good. Sounds like you're on top of things though.

Hope you enjoy your time with rsync :)


More information about the nSLUG mailing list