On May 31, 2011, at 4:25 PM, [email protected] wrote:
> Forum: Cfengine Help
> Subject: Re: check for existence of files > 30 minutes old
> Author: neilhwatson
> Link to topic: https://cfengine.com/forum/read.php?3,22276,22325#msg-22325
>
> I assume that you are working witha legacy CF2 install. If not then you
> should be using CF3 instead.
Not an option for the next 6 months.
>
> What do you see in the agent's verbose output? I recommend that you start
> small with this promise. Try to get the ctime working. Then move on the
> name regex.
The time functionality doesn’t seem to be working at all. My test data set is:
-rw-rw-r-- 1 usr1 grp1 10 May 11 12:51 OF_TEST.part
-rw-rw-r-- 1 usr1 grp1 10 May 11 12:53 OF_TEST1.part
-rwxrwxrwx 1 usr1 grp1 10 May 11 12:53 OF_TEST2.part
-rw-r--r-- 1 usr1 grp1 2 Jun 02 09:14 abcd.part
-rw-r--r-- 1 usr1 grp1 0 Jun 02 07:52 test.today
For files defined as:
files:
QAHost::
${QAhomedir}/APPS_STAGE
recurse=inf filter=Partials include=*.part action=alert
ifelapsed=1
and filter defined as:
filters:
{ Partials
FromMtime: "date(2011,6,1,0,0,0)"
ToMtime: "now"
Type: "file"
Result: "Type"
}
what gets matched is all of the files in the data set even though some of the
files are dated May:
Checking file(s) in /appsQED1/edi/APPS_STAGE
cfengine:host1: Alert specified on file
/appsQED1/edi/APPS_STAGE/OF/OF_TEST.part (m=664,o=287,g=236)
cfengine:host1: Alert specified on file
/appsQED1/edi/APPS_STAGE/OF/OF_TEST1.part (m=664,o=287,g=236)
cfengine:host1: Alert specified on file
/appsQED1/edi/APPS_STAGE/OF/OF_TEST2.part (m=777,o=287,g=236)
cfengine:host1: Alert specified on file /appsQED1/edi/APPS_STAGE/OF/abcd.part
(m=644,o=287,g=236)
Based on what I’ve defined, I’m expecting only the files that have a
modification time beginning June 1st to now to be matched. Can someone please
explain what I’m not understanding about how the time functions in a filter
definition work?
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine