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. Thanks, Giampaolo
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.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20100101/bbaa3706/attachment.html>