From owner-freebsd-questions@FreeBSD.ORG Sun Mar 14 12:10:33 2004 Return-Path: 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 9A14716A4CE for ; Sun, 14 Mar 2004 12:10:33 -0800 (PST) Received: from mail.mi.celestial.com (dagney.celestial.com [192.136.111.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B7FA43D1F for ; Sun, 14 Mar 2004 12:10:33 -0800 (PST) (envelope-from bill@celestial.com) Received: by mail.mi.celestial.com (Postfix, from userid 203) id CA4C411E8A0; Sun, 14 Mar 2004 12:10:32 -0800 (PST) Date: Sun, 14 Mar 2004 12:10:32 -0800 From: Bill Campbell To: freebsd-questions@freebsd.org Message-ID: <20040314201032.GA72170@alexis.mi.celestial.com> Mail-Followup-To: freebsd-questions@freebsd.org References: <4054B6A3.7080704@stevenfettig.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4054B6A3.7080704@stevenfettig.com> User-Agent: Mutt/1.4.1i Subject: Re: Two-way Sync of Directories - how? (rsync?) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd@celestial.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Mar 2004 20:10:33 -0000 On Sun, Mar 14, 2004, Steven N. Fettig wrote: >I have two workstations I use (one at home and one at work) connected >via a private DSL link that each have the directories /home/me. I want >to run a cron job to sync the directories (bi-directionally). Rsync >seems to work only in one direction (I know I could set up the script on >both machines), but I wanted to see if I could run the script on one >machine and simply copy new files over to the lacking machine or update >files via checksums (where a file has been updated on one machine and I >want that updated file to be copied over the old file on the other >machine). I am not worried about the case where I might update a given >file on both machines at the same time - it doesn't happen. >Any advice and scripts that you use to accomplish this? I would do this with two rsync runs from one machine cd $directory rsync -e ssh -vaurP ./ $remote:$directory rsync -e ssh -vaurP $remote:$directory/ . Better yet, set up the directories in the rsyncd.conf files on each machine: cd $directory rsync -vaurP ./ ${remote}::dir_module/ rsync -vaurP ${remote}::dir_module/ . Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ More laws, less justice. -- Marcus Tulius Ciceroca (42 BD)