From owner-freebsd-questions@FreeBSD.ORG Fri Oct 27 20:48:52 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 528E816A40F for ; Fri, 27 Oct 2006 20:48:52 +0000 (UTC) (envelope-from malcolm.kay@internode.on.net) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA03743D5E for ; Fri, 27 Oct 2006 20:48:51 +0000 (GMT) (envelope-from malcolm.kay@internode.on.net) Received: from alpha.home (ppp66-14.lns3.adl2.internode.on.net [121.44.66.14]) by smtp3.adl2.internode.on.net (8.13.6/8.13.5) with ESMTP id k9RKmiMn043217; Sat, 28 Oct 2006 06:18:45 +0930 (CST) (envelope-from malcolm.kay@internode.on.net) From: Malcolm Kay Organization: at home To: freebsd-questions@freebsd.org Date: Sat, 28 Oct 2006 06:18:44 +0930 User-Agent: KMail/1.8 References: <20061027174512.GA88552@thought.org> In-Reply-To: <20061027174512.GA88552@thought.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610280618.44238.malcolm.kay@internode.on.net> Cc: Gary Kline Subject: Re: rsync does not --exclude: (??) 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, 27 Oct 2006 20:48:52 -0000 On Sat, 28 Oct 2006 03:15 am, Gary Kline wrote: > People, > > Weeks ago I tried this *without* the --exclude flags and > overwrote DOT file that I didn't want to. Iust rechecked > this use of rsync, saving important files from my work server > elseswhere, and see that some files or directories are being > listed and copied over. IDoes anything obvious jump out here? > > gary > > > > # > ## test2ethos.sh > # > > rsync -Cptuvaz -n -e "ssh -i > /home/kline/.ssh/tao_XXXYYYZZZ-id" \ --exclude > /home/kline/.zlogin \ > --exclude /home/kline/.zshrc \ > --exclude /home/kline/.zhistory.* \ An ambiguous argument to the --exclude option /home/kline/.zhistory.* will need to be quoted . . . --exclude '/home/kline/.zhistory.*' \ otherwise it is expanded by the shell before reaching rsync and then only the first referenced file is preceded by --exclude. So instead of being excluded the transfer of the rest of the expansion is emphasised. I don't know how rsync will then deal with subsequent options. > --exclude /home/kline/.ctwrm \ > --exclude /home/kline/.mozilla \ > --exclude /home/kline/.evolution \ > --exclude /home/kline/4zip/ \ > --exclude '/home/kline/www/' \ > /home/kline kline@ethos:/home/kline > if [ $? = 0 ] > then > echo "rsync transfer went okay: tao to ethos" > else > echo "rsync failed to ethos from /home/kline"|mail > kline@thought.org fi Malcolm