From owner-freebsd-questions@FreeBSD.ORG Thu Jan 10 19:28:11 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 21547B8E for ; Thu, 10 Jan 2013 19:28:11 +0000 (UTC) (envelope-from dweimer@dweimer.net) Received: from webmail.dweimer.net (24-240-198-187.static.stls.mo.charter.com [24.240.198.187]) by mx1.freebsd.org (Postfix) with ESMTP id D9654329 for ; Thu, 10 Jan 2013 19:28:10 +0000 (UTC) Received: from www.dweimer.net (webmail.dweimer.local [192.168.5.1]) by webmail.dweimer.net (8.14.5/8.14.5) with ESMTP id r0AJGeLp064194 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 10 Jan 2013 13:16:41 -0600 (CST) (envelope-from dweimer@dweimer.net) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 10 Jan 2013 13:16:40 -0600 From: dweimer To: Subject: Re: Syncing Two Dirs With Rsync Organization: dweimer.net Mail-Reply-To: In-Reply-To: <50EF0F1F.8080904@tundraware.com> References: <50EF0F1F.8080904@tundraware.com> Message-ID: X-Sender: dweimer@dweimer.net User-Agent: Roundcube Webmail/0.8.1 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: dweimer@dweimer.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 19:28:11 -0000 On 2013-01-10 12:57, Tim Daneliuk wrote: > I have used rsync for many years to make sure a destination > machine:directory is kept up-to-date with some source master > directory. > > I now need to find a way to keep two different machine:dirs > in sync with each other. But for any given file, I don't know > which of these is newer so I don't know "which way" to sync. > > For example given: > > machineA::/dir/foo machineB:/dir/foo > machineA::/dir/bar machineB:/dir/bar > > Say the machineA has the newest foo, but machineB has the > newest bar. At the end of syncing, I want both machines > to have the latest copies of everything. > > I'm guessing there's a way to do this with rsync but I'm kind > of stumped. > > Ideas? Never tried it before, but I would think you could use the -u option to skip newer files, and do a push followed by a pull so that the newer files from each side get copied. However you wouldn't be able to use the delete files option as new files could get deleted instead of copied, depending on which side ran first. -- Thanks, Dean E. Weimer http://www.dweimer.net/