Forum: CFEngine Help
Subject: Re: reporting on existence of files in a directory
Author: phnakarin
Link to topic: https://cfengine.com/forum/read.php?3,27088,27093#msg-27093
Try this one. Not quite sure that it is good enough but it should do what you
like.
# I didn't try the code. :-D
bundle agent main
{
vars:
any::
"file_list" string => execresult("/usr/bin/find
/apps/myApp_files/errors/time -type f","noshell");
classes:
any::
"have_files" expression => regcmp(".*errors.*","$(file_list)");
reports:
have_files::
"These files need to be deleted:";
" --> $(file_list)";
}
Cheers,
-- Nakarin
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine