Forum: CFEngine Help
Subject: Re: garbage collection - not deleting all files
Author: neilhwatson
Link to topic: https://cfengine.com/forum/read.php?3,23905,23908#msg-23908

Can't reproduce but, I am using a much later version that you are.

body common control
{
        bundlesequence => { "garbage_collection" };
        inputs => { "cfengine_stdlib.cf" };
}


bundle agent garbage_collection
{
        files:

          "/tmp/testdelete"

                comment => "Garbage collection of any output files",
                 delete => tidy,
                  file_select => days_old("3"),
                        depth_search => recurse("inf");


}
neil@ettin ~/.cfagent $ ls -ltr /tmp/testdelete/
total 0
-rw-r--r-- 1 neil neil 0 Nov  1  2010 oldest
-rw-r--r-- 1 neil neil 0 Sep 10 00:00 old
-rw-r--r-- 1 neil neil 0 Nov  7 15:11 new
neil@ettin ~/.cfagent/inputs $ ../bin/cf-agent -IKf ./delbug.cf 
 -> Deleted file /tmp/testdelete/old
 -> Deleted file /tmp/testdelete/oldest
neil@ettin ~/.cfagent/inputs $ ls -ltr /tmp/testdelete/
total 0
-rw-r--r-- 1 neil neil 0 Nov  7 15:11 new
neil@ettin ~/.cfagent/inputs $ touch -d 20101107 /tmp/testdelete/oldest
neil@ettin ~/.cfagent/inputs $ ls -ltr /tmp/testdelete/
total 0
-rw-r--r-- 1 neil neil 0 Nov  7  2010 oldest
-rw-r--r-- 1 neil neil 0 Nov  7 15:11 new
neil@ettin ~/.cfagent/inputs $ ../bin/cf-agent -IKf ./delbug.cf 
 -> Deleted file /tmp/testdelete/oldest
neil@ettin ~/.cfagent/inputs $ ../bin/cf-agent -V

   @@@      
   @@@      cf-agent
            
 @ @@@ @    CFEngine Core 3.2.0
 @ @@@ @    
 @ @@@ @    
 @     @    
   @@@      
   @ @      
   @ @      
   @ @      

Copyright (C) Cfengine AS 2008-2011


_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to