Forum: CFEngine Help
Subject: Re: CFEngine Help: Re: Rsync like replication
Author: sauer
Link to topic: https://cfengine.com/forum/read.php?3,25914,25926#msg-25926

jonesy1234 Wrote:
-------------------------------------------------------
> I don't want to join the two as this would mean my
> heap files outside of path_name would get sync'd.
> 
> Basically these are the rules I'm after:-
> 
> Don't sync anything within
> /t02/middleware/admin/domains/.*server/.*/servers/
> .*/logs/.* but create the dirs
> 
> Don't sync heapdump.* anywhere in the tree.
> 
> My testing so far appears to show that a sync_cp
> with leaf_name files excluded doesn't purge the
> destination it they were copied before the exclude
> was added to the bundle>?


If you have two rules and they must both be satisfied, it sure seems like you 
want an "and" between them. :)  Our buddy DeMorgan would like me to take this 
time to remind everyone that "not a and not b" is the same as "not (a or b)", 
and that "not a or not b" is the same as "not (a and b)".  So, when you use an 
"or" in there, you're only deselecting things where both rules match.  You want 
to deselect things where either rule matches, and thus, either !(a|b) or !a&!b.

Or, with less math: You're selecting all files which aren't named heapdump.  
That .gz file is not named heapdump, so the path part of the expression doesn't 
matter (back to math: "true or 'anything'" is always true).

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to