From owner-freebsd-questions@FreeBSD.ORG Fri Sep 29 00:35:37 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 53B1716A407 for ; Fri, 29 Sep 2006 00:35:37 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from mail.stovebolt.com (webmail.stovebolt.com [66.221.101.249]) by mx1.FreeBSD.org (Postfix) with ESMTP id F25E643D46 for ; Fri, 29 Sep 2006 00:35:36 +0000 (GMT) (envelope-from pauls@utdallas.edu) Received: from [192.168.2.102] (adsl-66-140-60-40.dsl.rcsntx.swbell.net [66.140.60.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.stovebolt.com (Postfix) with ESMTP id 7D762114314 for ; Thu, 28 Sep 2006 19:37:55 -0500 (CDT) Date: Thu, 28 Sep 2006 19:35:30 -0500 From: Paul Schmehl To: freebsd-questions@freebsd.org Message-ID: In-Reply-To: <451B7AD3.3000107@locolomo.org> References: <765A325E54DCF1DC39EBF9AE@utd59514.utdallas.edu> <20060927220439.GC45831@dan.emsphone.com> <451B7AD3.3000107@locolomo.org> X-Mailer: Mulberry/4.0.5 (Mac OS X) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=sha1; protocol="application/pkcs7-signature"; boundary="==========4C37E6B078144F864C88==========" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Sync files locally? 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: Fri, 29 Sep 2006 00:35:37 -0000 --==========4C37E6B078144F864C88========== Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline --On September 28, 2006 9:33:39 AM +0200 Erik Norgaard=20 wrote: > > 1) rsync changes behaviour depending on whether or not you include a > trailing / from the man-page: > > rsync -av /src/foo /dest > rsync -av /src/foo/ /dest/foo > That I know. > works the same way, (and sync locally in this example). Read the man > page, there are lots of examples. > > 2) The options -t and -p preserve time and permissions respectively. > Ownership will always change to the user running rsync unless you run as > root. This has nothing to do with rsync, you can't run chown as an > ordinary user. > > You can preserve the group if you're in that group on the destination > host. > > 3) The files you are syncing - should they be writeable by www? For > security, you may really want something like this: > > -rw-r----- user:www file > They're user:www, but the user isn't me. :-) I could go into the reasons for that, but it doesn't really matter. > and have user do the rsync. If you really need to have www write to the > file, set group permissions +w. > No, I don't need that and don't want it either. The owners of the site=20 own the files, and I know how to use sudo. :-) > > IIRC to run rsync over ssh the user doing the syncing must have shell > access, running your sync as root is not desirable, it MAY be preferred > to have it run as www to preserve owner also, at least you can restrict > access for www. > I use ssh with keys so I can cron the job, but I'll have to do the extra=20 step of fixing perms and ownership after copying the rsynced files over.=20 No big deal. I'll script that as well. Paul Schmehl (pauls@utdallas.edu) Adjunct Information Security Officer The University of Texas at Dallas http://www.utdallas.edu/ir/security/ --==========4C37E6B078144F864C88==========--