rsync 3.0.4 under cygwin: problems with --exclude
Matt McCutchen
matt at mattmccutchen.net
Fri Aug 21 00:06:29 MDT 2009
On Tue, 2009-08-18 at 16:58 +0200, Alessandro Toso wrote:
> I'm trying to backup a disk using rsync but I need to exclude some folder. I'm using rsync 3.0.4 under cygwin on a winxp machine.
> The script that I use is:
>
> # ---------------------------------------------------------------- #
> SRCDIR=/cygdrive/d
> LOGDIR=/cygdrive/f
> BCKDIR=/cygdrive/f/Backup
>
> rsync -auv --progress --delete --delete-excluded --log-file=$LOGDIR/`date +%Y%m%d`.log --exclude from='/cygdrive/f/.bak_exclude' $SRCDIR/ $BCKDIR
> # ---------------------------------------------------------------- #
>
> and my file where there is the list of excluded folders looks like:
>
> # ---------------------------------------------------------------- #
> - /cygdrive/d/Software/
> - /cygdrive/d/Intel/
> - /cygdrive/d/Sysprep2003/
> - /cygdrive/d/RECYCLER/
> # ---------------------------------------------------------------- #
>
> The problem is that rsync is not skipping these folders.
Exclude patterns with a leading slash are interpreted from the root of
the transfer, in this case /cygdrive/d/ . So you should not include
that prefix in your patterns. See "ANCHORING INCLUDE/EXCLUDE PATTERNS"
in the rsync man page for more details.
--
Matt
More information about the rsync
mailing list