Forum: CFEngine Help
Subject: Select files
Author: skycoyotte
Link to topic: https://cfengine.com/forum/read.php?3,24901,24901#msg-24901
Hi
I want to zeroing files bigger than 500 MB, on a signle directory.
I wrote this agent :
bundle agent garbage_collection
{
files:
any::
"/dir/to/watch/logs"
comment => "Empty files > 500MB",
file_select => data_log_size(".*","5000000","inf"),
depth_search => recurse("1"),
transformer => "/bin/dd if=/dev/zero of=$(this.promiser) bs=1 count=1";
}
body file_select data_log_size(a,b,c)
{
leaf_name => { "$(a)" };
search_size => irange("$(b)", "$(c)");
file_types => { "dir" };
file_result => "!file_types";
}
I use the !files_types as the result because i don't want to get sub dir.
I have 2 test file under the dir. First one --> 56MB, second --> 530 MB.
But when i execute, CFE delete both files.
Perhaps there is a mistake on my file_result ?
Thanks for your help
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine