[nSLUG] rsync questions

Vlado Keselj vlado at cs.dal.ca
Tue Feb 22 07:09:52 AST 2011


On Tue, 22 Feb 2011, Mike Spencer wrote:

> Two questions about rsync.  First question:
> 
> The manpage says that if...
> 
>     (a) you  set an envar RSYNC_PASSWORD to <password> 
> or
>     (b) create a password file that is not world readable, containing
>         only the relevant password and pass that filename on the
>         command line with --password-file=<filename>
> 
> then you won't be prompted for a password when the rsync connection is
> established. 
> 
> Neither of those seems to work for me.  I'm still prompted in either
> case.  What am I missing?
> 
> I have the same username and user ID on both machines.
> /etc/hosts.equiv on DEST includes hostname of SRC. rsync works fine
> once password is entered in response to the prompt.  I don't have an
> /etc/rsyncd.conf file and I'm not running "rsync --daemon" beforehand
> on host DEST.

These passwords refer to the use of RSYNC server, and it seems that you 
are not using it.  I normally also do not use the rsync server, and prefer 
to go over the default ssh connection, which may be more secure, tested, 
and robust.  I use it even on a LAN.

My approach is normally to set ssh password less access from one account 
a1 at h1 to a2 at h2 by copying the public key from a1 at h1 (id_rsa.pub) to the 
file ~/.ssh/authorized_keys at a2 at h2, and then you can ssh, scp, or rsync 
without password back and forth from a1 at h1.  (If you want I can send more 
information about this.)

> Second question:
> 
> I can either 
> 
>      use rsync from host SRC to host DEST over my LAN or 
> 
>      mount a partition of host DEST's HD on host SRC and then
>      do rsync "locally".
> 
> The traffic has to go over my (not very fast) router in either case.
> The mount alternative is simpler.
>
> But am I right in believing that doing the mount method defeats the
> capability of rsync to transmit only file differences over the link?

That is a very good point!  You are right, both of the communicating rsync 
processes (local and remote) will run on the same machine, so the "remote" 
rsync will need to read the data through the network link.

> I'm not at all clear on how rsync does this trick but if all the
> computation is being done on localhost (SRC), will I be losing the
> purported speed gain rsync offers?  Or not?

Yes.

> All this because I want to script a backup plan for ~/ and have a
> second computer with a relatively recent HD.

Good idea.  I use rsync for incremental backup a lot.  I find particlarly 
useful incremental copies using --backup and --backup-dir options, e.g.
TAG=`date +%y%m%d-%T`
rsync ... --backup --backup-dir=/home/backup/acct-old/$TAG ...


Regards,
Vlado

> 
> TIA,
> - Mike
> 
> -- 
> Michael Spencer                  Nova Scotia, Canada       .~. 
>                                                            /V\ 
> mspencer at tallships.ca                                     /( )\
> http://home.tallships.ca/mspencer/                        ^^-^^
> _______________________________________________
> nSLUG mailing list
> nSLUG at nslug.ns.ca
> http://nslug.ns.ca/mailman/listinfo/nslug
> 



More information about the nSLUG mailing list