RE: Occasional but consistent trouble with --filter

2010-01-02 Thread Giampaolo Tomassoni
 On Fri, Jan 1, 2010 at 7:46 AM, Giampaolo Tomassoni giampa...@tomassoni.biz 
 wrote:
 '--filter=-!r /srv/vhome/*/users/*/.mail/' u...@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 u...@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 u...@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 
(X/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 XX/ 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

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Occasional but consistent trouble with --filter

2010-01-01 Thread Giampaolo Tomassoni
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/' u...@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

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html