help-cfengine
[Top][All Lists]
Advanced

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

Re: Testing File Mod (Time or Sum) to define action


From: Brian E. Seppanen
Subject: Re: Testing File Mod (Time or Sum) to define action
Date: Fri, 29 Jul 2005 09:48:32 -0400 (EDT)

On Thu, 28 Jul 2005, Brendan Strejcek wrote:

Brian E. Seppanen wrote:

I'm not copying it from anywhere. I want cfagent to test this file
at specific times. If this file has changed from the last check then
define an action.

Keep a copy and compare it to the original. If they are different, then
define a class. You can use the IsNewerThan evaluated class:

   classes:
       file_changed = ( IsNewerThan(/copy/file,/main/file) )

See 
http://www.cfengine.org/docs/cfengine-Reference.html#Evaluated-classes-and-special-functions

And then have whatever action you take based on "file_changed" being
defined also update /copy/file from /main/file if you only want the
action to happen once.

You might also want to use ChangedBefore, depending on what you are
after.

Thanks for the insight. I've now got cfagent doing some pretty elaborate safety checks for an applications that is going to have multiple untrusted data input sources on multiple hosts, while requiring restarts periodically for configuration updates made by untrusted sources. Having this in place keeps the application running, notifies me if there are any problems so I can get them fixed, and also permits expanded usage of the application in ways it probably wasn't originally thought possible.

Damn if I could kiss cfengine I would. And I still have only used a fraction of functionality...

Thanks for all of the help folks:
Brian Seppanen
608.826.1464




reply via email to

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