help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy purge vs. ignore


From: Chris (Ducky) Chapin
Subject: Re: copy purge vs. ignore
Date: Sun, 28 Jul 2002 12:55:41 -0700 (PDT)

"ignore" doesn't look at the full paths, only the base. Try "ignore=foo"
in the first copy.

Also, exclude won't work at all for this purpose. exclude will make
cfengine not copy "foo", but still go down the foo path, copying what's in
there, and making a directory "foo" at the destination because it needs a
place to put those files it found in source "foo", right? =)

Confusing? kinda. One way to think about it is "ignore" will actually
prune any file/directory, while "exclude" will simply not copy that ONE
directory/file, but still follow it if it's a directory.

HTH

-Ducky

--

 Christopher 'Ducky' Chapin                        ducky@qualcomm.com
 Unix Systems Administrator - Qualcomm, Inc.           (858) 651-5433
 IT Host Services - AE-209F                                 


On Sat, 27 Jul 2002, benf wrote:

> I'm using 2.0.3 on redhat 7.2 and I'm trying to clean up my cfengine config
> so that it doesn't keep
> purging files and then replacing the deleted files in a subsequent step.
> 
> I would like to do:
> copy:
>         # Sync up cron.daily but ignore
>         # foo if it exists
>         any::
>                 /etc/cron.daily
>                         dest=/etc/cron.daily
>                         action=fix
>                         ignore=/etc/cron.daily/foo
>                         server=$(cf_server)
>                         recurse=inf
>                         purge=on
> 
>         # copy foo into place if got deleted
>         specialhost::
>                 /etc/cron.daily/Unused/foo
>                         dest=/etc/cron.daily/foo
>                         action=fix
>                         server=$(cf_server)
>                         recurse=inf
>                         purge=on
> 
> 
> What always happens is the the first copy
> deletes foo as purge is on, even though it
> should ignore it.
> 
> Then the second section repairs this problem.
> I'm trying to avoid having to do the repair
> every time cfengine runs as that just adds
> to the chatter in the output. And wastes
> valuable computrons!
> 
> 
> To test this more, I setup a test system with:
>         On the CF server:
>                 /tmp/test
>                 /tmp/test/foo-onserver (a file)
> 
>         On the client side:
>                 /tmp/test
>                 /tmp/test/foo-onclient (a file)
> 
> 
> 
> With the following config:
>         copy:
>                 # Stuff done on every run
>                 any::
>                         /tmp/test
>                                 dest=/tmp/test
>                                 action=fix
>                                 ignore=foo-onclient
>                                 ignore=/tmp/test/foo-onclient
>                                 server=$(cf_server)
>                                 recurse=inf
>                                 purge=on
> 
> foo-onserver gets copied like one would expect,
> yet foo-onclient gets deleted.
> If I put foo-onclient on the server, it then
> works better - it will not copy foo-onclient again
> and will not purge it either.
> Though if the client version disappears it will
> copy the file over again.
> 
> I tried using includes instead of ignores, but
> the behaviour was the same.
> 
> So ignore with purge seems to mean copy
> everything from the server, but do not
> MODIFY ignored files that are on BOTH
> the server and the client. Delete anything
> on the client not on the server. Copy
> all files on the server that are not on
> the client, regardless of ignore setting.
> 
> Also, purge purges even if the action
> is warn! That seems counter-intuitive.
> 
> As I'm working on the model of having
> entire directies be identical except for
> a few different files on the client, this
> behavior is non-optimal.
> 
> I'm starting to go through the source,
> but it'll take some time to come up to speed.
> My first pass through PurgeFile makes it look
> like it doesn't support the situation where
> you want unique files on the client.
> 
> Oh yeah, I no longer have the segfault trouble
> with the latest version so Mark's fix worked!
> I do hate having my own patches on things....
> 
> thanks for any help,
> benf
> 
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]