Recommended rsync tutorials?

mark prgrmr at gmail.com
Tue Oct 19 16:04:44 EDT 2010


On Mon, Oct 18, 2010 at 8:28 PM, Bruce Labitt
<bruce.labitt at myfairpoint.net> wrote:
>  I'm looking to use rsync on a cron job to do some
> 'backup'.  I've read man rsync and a few 'tutorials'.  It
> looks not too hard - this worries me.  :)
>
> Anyone have a good/favorite tutorial on rsync that talks
> about how to do this over ssh and avoids common pitfalls?
> (like unmounted nfs...) lmgtfy, would not be too helpful.
> Done that, checked out a few of them, looking for something
> relatively understandable...
>
> -Bruce

The best way to positively identify that NFS-mounted file systems are
actually there without doing an ls or other I/O on them and risk
getting hung (for those filesystems mounted hard), is to first check
the output of the mount command that the system believes they should
be there, and then run rpcinfo -p [remotehost] on the originating host
system, but launch it from the remote system you are sync'ing to.

Example:  systemR is doing the rsync of particular directories from
systemA; systemA has NFS mounted file systems from systemB which
contain directories being targeted by the rsync.   You would need to
script an ssh connection from systemR to systemA to run mount and
collect the output, which you would process on systemR, grepping for
the file systems you expect to be there, and then extracting the
hostname/IP address of what ought to be systemB. Then initiate a
second ssh from systemR to systemA to run the "rpcinfo -p systemB"
command, where "systemB" is either the name or IP address of systemB.
You can then query that output to determine if nfs is indeed up and
running on systemB, which would, presumably, make the mounts on
systemA valid.    And by querying systemB from systemA, you also
simultaneously validate the network connection between the two of
them--as it's possible for the file systems to be mounted on systemA
and NFS to be running on systemB, but for the file to be inaccessible
due to loss of connectivity between those boxes.

Or you could abandon the manual rsync approach and use amanda instead.

--
mark



More information about the gnhlug-discuss mailing list