From owner-freebsd-questions@FreeBSD.ORG Thu Nov 24 05:16:08 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2B70106564A for ; Thu, 24 Nov 2011 05:16:07 +0000 (UTC) (envelope-from martin@dc.cis.okstate.edu) Received: from x.it.okstate.edu (x.it.okstate.edu [139.78.2.13]) by mx1.freebsd.org (Postfix) with ESMTP id C66608FC12 for ; Thu, 24 Nov 2011 05:16:07 +0000 (UTC) Received: from dc.cis.okstate.edu (localhost [127.0.0.1]) by x.it.okstate.edu (8.14.4/8.14.4) with ESMTP id pAO51jUb023756 for ; Wed, 23 Nov 2011 23:01:45 -0600 (CST) (envelope-from martin@dc.cis.okstate.edu) Message-Id: <201111240501.pAO51jUb023756@x.it.okstate.edu> To: "freebsd-questions@freebsd.org" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23754.1322110905.1@dc.cis.okstate.edu> Date: Wed, 23 Nov 2011 23:01:45 -0600 From: Martin McCormick Subject: Rsync and Preservation of Ownership and Permissions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 05:16:08 -0000 Rsync is a great utility, but is there a way to preserve ownership and permissions if rsync remotely logs in to a backup server as a normal user? The recovery process is run by root but copies all the files from the backup server as a normal user and uses its root capabilities to restore them. What happens now is that all the files end up owned by and in the group of the user ID that copied the information from the client to the server. That's obviously not too useful so I suspect there is a better way than trying to make a remote login to root from another system. Basically, cron starts a backup as root on system A. System A makes a remote ssh connection using the -e flag to backups@server. The system trying to recover the files starts a rsync process as root which remotely connects to backups@server to retrieve the files. In practice, the files come across but every last one of them is owned by and in the group of user backups. Any ideas are greatly appreciated. Thank you.