From owner-freebsd-questions@FreeBSD.ORG Sun Mar 14 22:54:03 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 BD9F616A4CE for ; Sun, 14 Mar 2004 22:54:03 -0800 (PST) Received: from mail.mi.celestial.com (dagney.celestial.com [192.136.111.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D20D43D1F for ; Sun, 14 Mar 2004 22:54:03 -0800 (PST) (envelope-from bill@celestial.com) Received: by mail.mi.celestial.com (Postfix, from userid 203) id 2E19F11E8A0; Sun, 14 Mar 2004 22:54:03 -0800 (PST) Date: Sun, 14 Mar 2004 22:54:03 -0800 From: Bill Campbell To: freebsd-questions@freebsd.org Message-ID: <20040315065403.GA94908@alexis.mi.celestial.com> Mail-Followup-To: freebsd-questions@freebsd.org References: <4054B6A3.7080704@stevenfettig.com> <20040314201032.GA72170@alexis.mi.celestial.com> <200403152037.13184.satimis@icare.com.hk> <87znaid47w.fsf@emptyhost.emptydomain.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87znaid47w.fsf@emptyhost.emptydomain.de> 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: Mon, 15 Mar 2004 06:54:03 -0000 On Mon, Mar 15, 2004, Kai Grossjohann wrote: ... >Explaining the trailing slash is more difficult. I just remember a >rule of thumb: if you want to copy directories with rsync, always >specify a trailing slash. On both the source and the destination. Of >course, "man rsync" has the full story... I find this is a bit tricky, and non-intuitive. If I do: rsync -var ./ system:dest/ Everything in the current directory is copied to the remote directory as it appears in the current directory. rsync -var subdir system:dest/ copies subdir to system:dest/subdir rsunc -var subdir/ system:dest/ copies subdir/* to systems:dest I often have use the ``-n'' option first to make sure it's going to do what I want before doing the real transfer. Incidently if one leaves off the trailing ``.'' for the destination when copying from a remote system to the current directory, rsync will show what it will copy if you have it set for verbose output, but won't do the copy. rsync -vaP remote:/path/\*.sh This will show which files it would copy rsync -vaP remote:/path/\*.sh . This will do the copy. 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 "Avoid revolution or expect to get shot. Mother and I will grieve, but we will gladly buy a dinner for the National Guardsman who shot you." -- Dr. Paul Williamson, father of a Kent State student