[Csync2] Partial path excludes?

Giampaolo Tomassoni g.tomassoni at libero.it
Fri Nov 30 14:23:30 CET 2007


> -----Original Message-----
> From: csync2-bounces at lists.linbit.com [mailto:csync2-
> bounces at lists.linbit.com] On Behalf Of Marcus Bointon
> 
> I have various hierarchies I want to sync, but there are some
> consistent patterns I want to exclude. From the docs it doesn't sound
> like I can exclude paths based on wildcards - I can either select
> explicit paths (/...), or partial filenames (*.php), but not partial
> paths (somedir/*). The particular case I have is for compiled Smarty
> templates - essentially anything inside a 'templates_c' directory
> (anywhere in the hierarchy, and there may be lots that I don't want to
> have to specify manually) should be ignored. In rsync I do --
> exclude="templates_c/*". I've tried:
> 
> exclude templates_c/*
> 
> but it didn't work (it still synced their contents). How can I do this
> in csync2?

I have something like that in my csync2.cfg:

	exclude /the_base_path_to_my_sites/*/home/www/views_c/*;

It works. However, my case is quite easy: the '/*/' never contains paths but
always a single dir (say, '/domain.tld/'). I don't know if the '/*/' "thing"
matches against a path (say, '/this/is/a/customer/path/'), but I think it
doesn't...

In this case, however, you may try to evince a few patterns in the paths you
want to exclude, then exclude each of them. Another way could be to
regularly use some external tool (like a script invoking 'find', in example)
to discover the paths containing a 'views_c' or 'template_c' directory, then
automatically add to csync2.cfg an exclude directive for each of these path
and, finally, csync the csync2.cfg file (this is important: csync2 mail fail
otherwise!).

Please also note that excluding a dir in a path may impede synchronizing the
removal of the whole path, because the path will not be empty in the target
system. So, if you want also to sync the removal of a site, the better thing
is to avoid 'exclude' in that path. By the way, the kind of exclusion you
want to do is probably due more to improving synch speed than to a real
need, isn't it? It may be worth avoiding this optimization if you prefer to
limit manual adjustments at a minimum.

Giampaolo


> 
> Marcus
> --
> Marcus Bointon
> Synchromedia Limited: Creators of http://www.smartmessages.net/
> UK resellers of info at hand CRM solutions
> marcus at synchromedia.co.uk | http://www.synchromedia.co.uk/
> 




More information about the Csync2 mailing list