Excludes not working

Dave Dykstra dwd at bell-labs.com
Fri Mar 22 03:26:05 EST 2002


On Tue, Mar 19, 2002 at 10:51:18AM -0700, Brashers, Bart -- MFG, Inc. wrote:
> I'm a relative newbie to rsync, I use it to backup (mirror) a bunch of
> Windows boxes.  I mount them using samba (to avoid having to install the
> cygwin version on each box) then run (using rsync 2.5.2 run from crontab)
> 
>  rsync -vuaz --delete-excluded --exclude-from=/root/bin/rsync.exclude \
>    --modify-window=2 /mnt/pc/machine/share /backup/machine/share
> 
> It works like a charm, except for some excludes that won't work -- rsync
> still copies the files.  Here's my exclude file:
> 
>  [~/bin]% ls rsync.exclude
>  -rw-r--r--    1 root     root          154 Mar  1 09:34 rsync.exclude
>  [~/bin]% cat rsync.exclude
>  /mnt/pc/machine/D/Music
>  System Volume Information/
>  RECYCLER
>  ffastun*
>  Program Files/
>  Temporary Internet Files/
>  msdownld.tmp/
> 
> It's the first line that doesn't work.  I've tried all possible combinations
> of leading and trailing slashes, stars, etc, found in the man page:
> 
>  /mnt/pc/machine/D/Music
>  /mnt/pc/machine/D/Music/
>  /mnt/pc/machine/D/Music/*
>  /mnt/pc/machine/D/Music/**
>  mnt/pc/machine/D/Music
>  mnt/pc/machine/D/Music/
>  mnt/pc/machine/D/Music/*
>  mnt/pc/machine/D/Music/**
> 
> The rest (even those with dreaded spaces in the names) work.  But it still
> keeps copying and updating this guy's music files (lots of WAVs). 


I don't understand why those paths are getting copied at all; they're
not under /mnt/pc/machine/share.  Or are you using the word "share" as
a generic name meaning something like "C" and "D" and you're copying them
both?



On Tue, Mar 19, 2002 at 11:10:32AM -0800, Mike Rubel wrote:
> 
> Bart Brashers wrote:
> > ... I mount them using samba (to avoid having to install the
> > cygwin version on each box) then run (using rsync 2.5.2 run from crontab)
> > 
> >  rsync -vuaz --delete-excluded --exclude-from=/root/bin/rsync.exclude \
> >    --modify-window=2 /mnt/pc/machine/share /backup/machine/share
> > 
> > It works like a charm, except for some excludes that won't work -- rsync
> > still copies the files.  Here's my exclude file:
> 
> >  /mnt/pc/machine/D/Music
>  ...
> 
> Hi Bart,
> I'm not an expert with rsync, so someone please correct me if I've got
> this wrong, but I think the way to exclude /mnt/pc/machine/D/Music would
> be like this:
> 
>   /Music/
> 
> Otherwise it's looking to exclude:
> 
>   /mnt/pc/machine/share/mnt/pc/machine/D/Music,
> 
> which of course doesn't exist.
> 
> Mike

Assuming Bart is actually specifying /mnt/pc/machine/D as the source,
Mike's answer is almost right.  The paths will start with "D" since that's
the basename of the source and the source doesn't end with a trailing
slash.  If I were Bart, I'd add the trailing slash so the paths can start
with Music.

- Dave Dykstra




More information about the rsync mailing list