[CentOS] rsync question

Mon Sep 7 21:51:47 UTC 2015
Carl E. Hartung <carlh04426 at gmail.com>

On Mon, 7 Sep 2015 14:58:00 -0400
Robert Moskowitz wrote:

> On 09/07/2015 02:17 PM, Carl E. Hartung wrote:
> > On Mon, 7 Sep 2015 13:05:59 -0400
> > Robert Moskowitz wrote:
8< - - - - - trimmed - - - - - >8
> > Do you really mean '-h' human-readable vs. '-H' preserve hard links?
> Yes.

Okay, good to know you're cognizant of the difference. ;-)

> > Why '-e' (specify remote shell to use)? Are these systems running
> > disparate operating systems?
> Somewhere I read that is what you need to run this over SSH.
> Otherwise you need to have rsyncd running on the remote system.

My understanding is that rsync defaults to SSH these days.

8< - - - - - trimmed - - - - - >8
> This is not an automated system.  It is typically a onetime thing to
> get a backup of what I did to set up a server (or the other way
> around).  I have this adversion of leaving my public key all over the
> place.

Then '--delete' is superfluous. It really only comes into play on
subsequent synchronizations when files that exist in the target need to
be deleted because they no longer exist at the source.

Your public key is only useful when it is paired with the corresponding
private key. And, since only you have access to the private key and it
resides only on systems where you've installed it, I think your
aversion is not well thought out.

> > Since this is a backup, you really should consider preserving ACLs
> > and extended attributes (-A -X,) too.
> Maybe, but then I can't edit it on my system if it is root:named!

Then you're not creating a true 'backup' as I understand the term. :-)
In any case, you can still edit these files as root. They'll retain the
original attributes when you save them.

8< - - - - - trimmed - - - - - >8
> In /etc there are 4 named.* files.  Do I have to do each separately?

Two lines, assuming first pass without public key authentication,
executed from the parent directory


of the backup that you're creating:

rsync -avAX root at named
--> Since the default protocol is SSH, you will be prompted for the
remote system's root password.

rsync -avAX root at* .
--> This will pick up the four named.* files and land them in the local
pwd due to the 'dot' passed to rsync as the target.

If you need to 'freshen up' a local snapshot, reinsert the '--delete'

hth & regards,