On Aug 9, 2012, at 6:29 AM, Aleksey Tsalolikhin wrote:

> Hi, Abid.  I agree with Nakarin - this smells like a bug.  What
> happens using the latest stable version (3.3.5) ?
> 
> Best,
> Aleksey

Hi Aleksey.  With 3.3.5, the behavior is the same.  Given this:

body common control
{
  bundlesequence => { "main" };
  inputs         => { "cfengine_stdlib.cf" };
  version        => "Community promises.cf $Rev: 37 $";
}
###############################################################################
bundle agent main
{
  vars:
     "dir_wl10domain"   string => "/Users/abid/tmp/bea10/user_projects/domains";
  classes:
     "WL10Host"        expression => fileexists("$(dir_wl10domain)");
  files:
     WL10Host::
        "$(dir_wl10domain)" file_select => name_age("Snap.*\.trc","14"),
                           depth_search => recurse(“0"),
                                 delete => tidy,
                                comment => "Delete old Weblogic Snap trace 
files",
                                 handle => "main_files_weblogic_tidy_snap";
        "$(dir_wl10domain)" file_select => name_age("heapdump\..*\.phd","14"),
                           depth_search => recurse(“0"),
                                 delete => tidy,
                                comment => "Delete old Weblogic heap dump 
files",
                                 handle => "main_files_weblogic_tidy_heapdump";
        "$(dir_wl10domain)" file_select => name_age("javacore\..*\.txt","14"),
                           depth_search => recurse(“0"),
                                 delete => tidy,
                                comment => "Delete old Weblogic java core 
files",
                                 handle => "main_files_weblogic_tidy_javacore";
        "$(dir_wl10domain)" file_select => name_age(".*\.out00.*","60"),
                           depth_search => recurse("3"),
                                 delete => tidy,
                                comment => "Delete old Weblogic log files",
                                 handle => "main_files_weblogic_tidy_logs";
}

we get:

cf3>     .........................................................
cf3>     Promise's handle: main_files_weblogic_tidy_snap
cf3>     Promise made by: "/Users/abid/tmp/bea10/user_projects/domains"
cf3> 
cf3>     Comment:  Delete old Weblogic Snap trace files
cf3>     .........................................................
cf3> 
cf3>  -> Using literal pathtype for /Users/abid/tmp/bea10/user_projects/domains
cf3>  -> Basedir "/Users/abid/tmp/bea10/user_projects/domains" not promising 
anything
cf3> 
cf3>     .........................................................
cf3>     Promise's handle: main_files_weblogic_tidy_heapdump
cf3>     Promise made by: "/Users/abid/tmp/bea10/user_projects/domains"
cf3> 
cf3>     Comment:  Delete old Weblogic heap dump files
cf3>     .........................................................
cf3> 
cf3>  -> Using literal pathtype for /Users/abid/tmp/bea10/user_projects/domains
cf3>  -> Basedir "/Users/abid/tmp/bea10/user_projects/domains" not promising 
anything
cf3> 
cf3>     .........................................................
cf3>     Promise's handle: main_files_weblogic_tidy_javacore
cf3>     Promise made by: "/Users/abid/tmp/bea10/user_projects/domains"
cf3> 
cf3>     Comment:  Delete old Weblogic java core files
cf3>     .........................................................
cf3> 
cf3>  -> Using literal pathtype for /Users/abid/tmp/bea10/user_projects/domains
cf3>  -> Basedir "/Users/abid/tmp/bea10/user_projects/domains" not promising 
anything
cf3> 
cf3>     .........................................................
cf3>     Promise's handle: main_files_weblogic_tidy_logs
cf3>     Promise made by: "/Users/abid/tmp/bea10/user_projects/domains"
cf3> 
cf3>     Comment:  Delete old Weblogic log files
cf3>     .........................................................
cf3> 
cf3>  -> Using literal pathtype for /Users/abid/tmp/bea10/user_projects/domains
cf3>  ->>  Entering /Users/abid/tmp/bea10/user_projects/domains/myApp (0)
cf3>  ->>  Entering /Users/abid/tmp/bea10/user_projects/domains/myApp/servers 
(1)
cf3>  ->>  Entering 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1 (2)
cf3>  ->>  Entering 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1/logs (3)
cf3>  -> Handling file existence constraints on 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00001
cf3>  -> Verifying file deletions for 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00001
cf3> Promise requires deletion of file object 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00001
cf3>  -> Handling file existence constraints on 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00002
cf3>  -> Verifying file deletions for 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00002
cf3> Promise requires deletion of file object 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00002
cf3>  -> Basedir "/Users/abid/tmp/bea10/user_projects/domains" not promising 
anything

recurse(“1”) gives the same behavior.  recurse(“2”) does the file deletions as 
per policy but has to unnecessarily descend 2 additional subdirectory levels to 
do so:

cf3>     Promise's handle: main_files_weblogic_tidy_snap
cf3>     Promise made by: "/Users/abid/tmp/bea10/user_projects/domains"
cf3> 
cf3>     Comment:  Delete old Weblogic Snap trace files
cf3>     .........................................................
cf3> 
cf3>  -> Using literal pathtype for /Users/abid/tmp/bea10/user_projects/domains
cf3>  ->>  Entering /Users/abid/tmp/bea10/user_projects/domains/myApp (0)
cf3>  ->>  Entering /Users/abid/tmp/bea10/user_projects/domains/myApp/servers 
(1)
cf3>  ->>  Entering 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1 (2)
cf3>  -> Handling file existence constraints on 
/Users/abid/tmp/bea10/user_projects/domains/myApp/Snap123.trc
cf3>  -> Verifying file deletions for 
/Users/abid/tmp/bea10/user_projects/domains/myApp/Snap123.trc
cf3> Promise requires deletion of file object 
/Users/abid/tmp/bea10/user_projects/domains/myApp/Snap123.trc
cf3>  -> Basedir "/Users/abid/tmp/bea10/user_projects/domains" not promising 
anything
cf3> 
cf3>     .........................................................
cf3>     Promise's handle: main_files_weblogic_tidy_heapdump
cf3>     Promise made by: "/Users/abid/tmp/bea10/user_projects/domains"
cf3> 
cf3>     Comment:  Delete old Weblogic heap dump files
cf3>     .........................................................
cf3> 
cf3>  -> Using literal pathtype for /Users/abid/tmp/bea10/user_projects/domains
cf3>  ->>  Entering /Users/abid/tmp/bea10/user_projects/domains/myApp (0)
cf3>  ->>  Entering /Users/abid/tmp/bea10/user_projects/domains/myApp/servers 
(1)
cf3>  ->>  Entering 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1 (2)
cf3>  -> Basedir "/Users/abid/tmp/bea10/user_projects/domains" not promising 
anything
cf3> 
cf3>     .........................................................
cf3>     Promise's handle: main_files_weblogic_tidy_javacore
cf3>     Promise made by: "/Users/abid/tmp/bea10/user_projects/domains"
cf3> 
cf3>     Comment:  Delete old Weblogic java core files
cf3>     .........................................................
cf3> 
cf3>  -> Using literal pathtype for /Users/abid/tmp/bea10/user_projects/domains
cf3>  ->>  Entering /Users/abid/tmp/bea10/user_projects/domains/myApp (0)
cf3>  ->>  Entering /Users/abid/tmp/bea10/user_projects/domains/myApp/servers 
(1)
cf3>  ->>  Entering 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1 (2)
cf3>  -> Basedir "/Users/abid/tmp/bea10/user_projects/domains" not promising 
anything
cf3> 
cf3>     .........................................................
cf3>     Promise's handle: main_files_weblogic_tidy_logs
cf3>     Promise made by: "/Users/abid/tmp/bea10/user_projects/domains"
cf3> 
cf3>     Comment:  Delete old Weblogic log files
cf3>     .........................................................
cf3> 
cf3>  -> Using literal pathtype for /Users/abid/tmp/bea10/user_projects/domains
cf3>  ->>  Entering /Users/abid/tmp/bea10/user_projects/domains/myApp (0)
cf3>  ->>  Entering /Users/abid/tmp/bea10/user_projects/domains/myApp/servers 
(1)
cf3>  ->>  Entering 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1 (2)
cf3>  ->>  Entering 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1/logs (3)
cf3>  -> Handling file existence constraints on 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00001
cf3>  -> Verifying file deletions for 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00001
cf3> Promise requires deletion of file object 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00001
cf3>  -> Handling file existence constraints on 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00002
cf3>  -> Verifying file deletions for 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00002
cf3> Promise requires deletion of file object 
/Users/abid/tmp/bea10/user_projects/domains/myApp/servers/myApp1/logs/myAppLog.out00002
cf3>  -> Basedir "/Users/abid/tmp/bea10/user_projects/domains" not promising 
anything


_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to