From owner-freebsd-questions@FreeBSD.ORG Wed Sep 27 22:15:54 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 C539A16A412 for ; Wed, 27 Sep 2006 22:15:54 +0000 (UTC) (envelope-from norgaard@locolomo.org) Received: from strange.daemonsecurity.com (59.Red-81-33-11.staticIP.rima-tde.net [81.33.11.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4879343D5C for ; Wed, 27 Sep 2006 22:15:51 +0000 (GMT) (envelope-from norgaard@locolomo.org) Received: from [10.35.4.65] (65.4-35-10-static.chueca.wifi [10.35.4.65]) by strange.daemonsecurity.com (Postfix) with ESMTP id 232C52E024; Thu, 28 Sep 2006 00:15:50 +0200 (CEST) Message-ID: <451AF7D1.2050905@locolomo.org> Date: Thu, 28 Sep 2006 00:14:41 +0200 From: Erik Norgaard User-Agent: Thunderbird 1.5.0.7 (X11/20060916) MIME-Version: 1.0 To: Paul Schmehl References: <765A325E54DCF1DC39EBF9AE@utd59514.utdallas.edu> In-Reply-To: <765A325E54DCF1DC39EBF9AE@utd59514.utdallas.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org 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: Wed, 27 Sep 2006 22:15:54 -0000 Paul Schmehl wrote: > What's the best way to sync files locally? > > I'm running rsync over ssh to backup files from a server. Now I'm setting > up a new server, so I rsynced to it as well. The files end up in a subdir > of my home directory, because my account is being used for the rsync. I've > been using cp -R to put them in the right place on the server and the chmod > and chown to get the perms right, but I'm thinking there has to be a way to > sync the files locally so that only the ones that have changed or are new > have to be copied to the right place. > > I can use find to set the perms, but I'm not sure how to sync the files. > This is unix, so there's got to be a built-in utility that does this, but I > can't seem to find it. It's really a question of reading far enough in the man-page. I have eventually arrived at the options -Cptuvaz C for CVS omissions (exclude *.bak, *.tmp, *~ etc) p for preserve permisions t for preserving time u for update (using mtime I suppose) a for archive - recursive z for compression and with that, there should be no reason to sync into a separate dir and then copy. Cheers, Erik -- Ph: +34.666334818 web: http://www.locolomo.org X.509 Certificate: http://www.locolomo.org/crt/8D03551FFCE04F0C.crt Key ID: 69:79:B8:2C:E3:8F:E7:BE:5D:C3:C3:B1:74:62:B8:3F:9F:1F:69:B9