Occasional but consistent trouble with --filter

Giampaolo Tomassoni Giampaolo at Tomassoni.biz
Fri Jan 1 08:46:25 MST 2010

I'm running rsync version 3.0.6 in order to migrate a set of objects from an
old server to a new one.

The set of object to migrate is basically composed of mail dirs which follow
a well-defined name pattern, such that I believe it should be easily handled
by the --filter option.

I'm infact attempting to use the following rsync command in the new server:

rsync -auEAXDSvz --delete-after --numeric-ids --compress-level=9 --stats
--super --progress -e 'ssh -oCompression=no' '--filter=-!r
/srv/vhome/*/users/*/.mail/' user at oldserver:/srv/vhome /srv/

The command works *mostly* well, but occasionally (and consistently) it
attempts migrating or deleting stuff whose pathname seems not match the
filter spec above.

In example, the command always tries migrating files from
/vhome/xxx/home/www/admin/stats/, which I think can't fit in the
/srv/vhome/*/users/*/.mail/ filter.

Are double-wildcard filters like the one I'm using allowed in rsync? Is
there any way to circumvent this problem?

Please note that I can't simply merge the whole /srv/vhome/ dir, since I'm
attempting to complete the second phase of this server migration: all the
non mail related stuff had already been transferred and now is probably more
recent on the new server than on the old one...

Also note that the following command:

	find /srv -type d -wholename '/srv/vhome/*/users/*/.mail'

do selects the right directories to migrate and only them.



More information about the rsync mailing list