Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Nov 2011 08:05:33 -0600
From:      Martin McCormick <martin@dc.cis.okstate.edu>
To:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: Rsync and Preservation of Ownership and Permissions 
Message-ID:  <201111241405.pAOE5Xw9026028@x.it.okstate.edu>

next in thread | raw e-mail | index | archive | help
Michael Sierchio writes:
> Does the same user exist on the remote system, with the same uid, etc.?

Yes.

> If you're using rsync with ssh as the transport, and connecting to the
> remote machine as the backups user, that's who will own the files on
> its local filesystem...

I thought rsync had some encoding it might slip in to the tree
that another rsync run as root on the recovering system could
use to figure out all those thousands of ownerships and get them
all straight, but this makes perfect sense.
> You've written a lot of narrative, but show us precisely what commands
> you're running.  Why would you run the command as root, and ssh as
> backups, when you want them to be owned by "normal" ?

	Because root is the only user who can "see" files from
all other users so root starts the process. Here is what I
tried. Remember, folks, this will not work! This tries to backup
a system named z.

##!/bin/sh
#rsync --delete -alHvq --exclude "/proc" // backups@backup-server.okstate.edu:z

> You can run the command as root, and use restricted ssh keys (use
> authorized_keys to restrict it to executing a specific rsync
> command)....  you can run rsync as a regular user to that user's
> account on the remote system...

perryh@pluto.rain.com writes:
> Perhaps you could have rsync log in to a jail on the backup server,
> where it could safely be granted root permission.

Hmm. It's all rather clear, now. A jailed environment that looks
like root is about the only thing that could work.

	Thank you.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111241405.pAOE5Xw9026028>