Tag Archives: bundle

a sample cfengine promise bundle – delete “large” files

body common control
{
        bundlesequence => { "file_remover" };
}

bundle agent file_remover
{
        vars:
                "bigfile" int => "1g";
        files:
                "/home"
                delete => tidy,
                file_select => files_too_big,
                depth_search => recurse("inf");
        reports:
                "Deleted files over $(bigfile) in size from /home";
}

body depth_search recurse(d)
{
        depth => "$(d)";
}

body delete tidy
{
        dirlinks => "delete";
        rmdirs => "false";
}

body file_select files_too_big
{
        search_size => irange("$(bigfile)","inf");
        file_result => "size";
}