[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Testing File Mod (Time or Sum) to define action
From: |
Brendan Strejcek |
Subject: |
Re: Testing File Mod (Time or Sum) to define action |
Date: |
Thu, 28 Jul 2005 10:33:29 -0500 |
User-agent: |
Mutt/1.5.6+20040818i |
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.