Simon, if you want to act on that file or directory, and there's no certain need to distinguish between a change and a moment of creation, you can place a promise on them and use action => if_repaired for trigger further changes when necessary.
If you want to act on different objects using that file or directory just a trigger (left them unmanaged by Cfengine itself), you either have to use body changes (but it defines the persistent class for any change it catches, so action cannot be specific to the certain file or directory), or you could try setting your own classes based on files checking function calls which return classes (e.g. isnewerthan()). 2010/12/2 Simon Oxwell <simon.oxw...@controlcircle.com> > > > Hi, > > > > I’m looking to solve two related problems and was hoping to be able to > trigger them with classes based on a couple of conditions, but I’ve yet been > able to figure out how to do them. They are: > > > > · Setting a class if a specified file changes > > · Setting a class if a specified file or directory appears for the > first time > > > > I’ve had a look and bit of an experiment with the “changes in file “body, > but I’ve only been able to find examples (or been able to get working) of it > being used an reporting system for file changes in a tripwire-like scenario. > Does change correspond to a promise_repaired in this case? > > > > Ideally, I’d like to be set a class on a change, or if a particular file or > directory is generated, and use that to conditionally run some commands. > > > > Does anyone have any hints as to how I might best achieve this? > > > > > > Thanks, > > > > > > Simon > > > > -- > > *Simon Oxwell*** > > *ControlCircle*** > > *Senior Server Engineer*** > > *The Datacentre People*** > > 0044 (0)20 7517 6594 > > Hertsmere House, 2 Hertsmere Road, > > simon.oxw...@controlcircle.com > > London, E14 4AB > > > > > > _______________________________________________ > Help-cfengine mailing list > Help-cfengine@cfengine.org > https://cfengine.org/mailman/listinfo/help-cfengine > > -- SY, Seva Gluschenko.
_______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine