cf3.2.3

Given the following:

      "dir_wl10domain"   string => "/apps/bea10/user_projects/domains”;

         "$(def.dir_wl10domain)" file_select => name_age(".*\.out00.*","60"),
                            depth_search => recurse("3"),
                                  delete => tidy;

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

I get this:

cf3>  -> Using literal pathtype for /apps/bea10/user_projects/domains
cf3>  ->>  Entering /apps/bea10/user_projects/domains/myApp (0)
cf3>  ->>  Entering /apps/bea10/user_projects/domains/myApp/servers (1)
cf3>  ->>  Entering /apps/bea10/user_projects/domains/myApp/servers/myApp1 (2)
cf3>  ->>  Entering /apps/bea10/user_projects/domains/myApp/servers/myApp1/logs 
(3)
cf3>  -> Handling file existence constraints on 
/apps/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00001
cf3>  -> Verifying file deletions for 
/apps/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00001
cf3> Promise requires deletion of file object 
/apps/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00001

This lead me to understand that recurse() starts with a zero index value and 
increments each subdirectory starting with the subdirectory of the base 
specified, i.e., since the base is /apps/bea10/user_projects/domains, 
recurse(“0”) refers to /apps/bea10/user_projects/domains/myApp.  Easy logic - I 
can see how this works.

So then I do this expecting to age files ONLY in 
/apps/bea10/user_projects/domains/myApp:

         "$(def.dir_wl10domain)" file_select => name_age("Snap.*\.trc","14"),
                            depth_search => recurse("0"),
                                  delete => tidy;

But what I get is only this:

cf3>  -> Using literal pathtype for /apps/bea10/user_projects/domains

Files in /apps/bea10/user_projects/domains/myApp are not touched.  I try 
recurse(“1”) - same result.  recurse(“2”) gives me:

cf3>  -> Using literal pathtype for /apps/bea10/user_projects/domains
cf3>  ->>  Entering /apps/bea10/user_projects/domains/myApp (0)
cf3>  -> Handling file existence constraints on 
/apps/bea10/user_projects/domains/myApp/Snap545.trc
cf3>  -> Verifying file deletions for 
/apps/bea10/user_projects/domains/myApp/Snap545.trc
cf3> Promise requires deletion of file object 
/apps/bea10/user_projects/domains/myApp/Snap545.trc
cf3>  ->>  Entering /apps/bea10/user_projects/domains/myApp/servers (1)
cf3>  ->>  Entering /apps/bea10/user_projects/domains/myApp/servers/myApp1 (2)

Can someone please explain what happened?
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to