Occasional but consistent trouble with --filter

Giampaolo Tomassoni Giampaolo at Tomassoni.biz
Sat Jan 2 04:23:45 MST 2010


> On Fri, Jan 1, 2010 at 7:46 AM, Giampaolo Tomassoni <Giampaolo at tomassoni.biz> wrote:
> '--filter=-!r /srv/vhome/*/users/*/.mail/' user at oldserver:/srv/vhome /srv/
> 
> See the manpage discussion of anchoring at the top-level of the transfer for why 
> your filter rule should not have a "/srv" prefix.  The 'r' modifier makes the rule 
> only apply on the receiving side, which means you're specifying a protect rule to 
> prevent removal of files, but does not stop the files from being copied.  
> The '!' modifier negates the match, which makes it protect everything from 
> deletion except .mail dirs (though, since its anchored wrong, it would seem to 
> protect everything from deletion).
> 
> Perhaps you wanted to specify --filter='- /vhome/*/users/*/.mail/'  (for both 
> excluding and deleting of that dir)?  If not -- if you're really trying to copy 
> just hte .mail dirs, you have a lot more things to change.
> 
> ..wayne..

Thank you Wayne,

I'm actually trying to copy the .mail dirs.

Based on your hints, I also tried the followings in the new server:

rsync -auEAXDSvz --delete-during --numeric-ids --compress-level=9 --stats
	--super --bwlimit=15 --progress -e 'ssh -oCompression=no'
	'--filter=+ /*/ + /*/users/ + /*/users/*/ + /*/users/*/.mail/ + /*/users/*/.mail/* - *'
	--dry-run user at oldserver:/srv/vhome/ /srv/vhome/

rsync -auEAXDSvz --delete-during --numeric-ids --compress-level=9 --stats
	--super --bwlimit=15 --progress -e 'ssh -oCompression=no'
	'--filter=+ /*/ + /*/users/ + /*/users/*/ + /*/users/*/.mail/ + /*/users/*/.mail/* - /**'
	--dry-run user at oldserver:/srv/vhome/ /srv/vhome/

this command (which perhaps follows your "you have a lot more things to change" hint) yields exactly the same results of the previous (with '--filter=-!r /srv/vhome/*/users/*/.mail/'). You may see that I'm not using the 'r' modifier anymore.

I'm suspecting there is something wrong in the way the rsync pattern filtering code works: it works most of the time, but occasionally it doesn't. In example it keeps replicating the content in a /srv/vhome/ dir (XXXXX/home/www/components/com_lightgallery/views/list/tmpl/index.html) which can't resemble any of the '+' patterns given in --filter.

In example, adding some -vvv to a --list-only version of the above commands, I see this:

	[sender] flist start=1, used=82, low=0, high=81
	[sender] i=1 /srv/vhome ./ mode=040755 len=2640 uid=0 gid=0 flags=5
	[sender] i=2 /srv/vhome .DS_Store mode=0100640 len=21508 uid=0 gid=0 flags=0
	[sender] i=3 /srv/vhome XXXXXX/ mode=040755 len=96 uid=0 gid=81 flags=4

Why the file /srv/vhome/.DS_Store is selected for the transfer? Which filtering rule selects it?

I'm stuck.

Giampaolo



More information about the rsync mailing list