Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Oct 2006 06:18:44 +0930
From:      Malcolm Kay <malcolm.kay@internode.on.net>
To:        freebsd-questions@freebsd.org
Cc:        Gary Kline <kline@tao.thought.org>
Subject:   Re: rsync does not --exclude: (??)
Message-ID:  <200610280618.44238.malcolm.kay@internode.on.net>
In-Reply-To: <20061027174512.GA88552@thought.org>
References:  <20061027174512.GA88552@thought.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610280618.44238.malcolm.kay>