| Puppet Version: 6.26.0 {}Puppet Server Version: 2019.8.10 {}OS Name/Version: RHEL 7 The documentation for the age parameter for the tidy type states:
Tidy files whose age is equal to or greater than the specified time. You can choose seconds, minutes, hours, days, or weeks by specifying the first letter of any of those words (for example, ‘1w’ represents one week).
Docs: https://puppet.com/docs/puppet/7.7/types/tidy.html#tidy-attribute-age
Specifying 0 will remove all files.
Desired Behavior: Setting age=1w removes all files more than 1 week old Actual Behavior: It's not removing any files, details of the testing below
[root@pepm reports]# pwd |
/tmp/comply/assessors/4.19.0/Assessor-CLI/reports |
|
[root@pepm reports]# ls -lrt |
total 3904 |
-rw-r--r-- 1 root root 995383 Dec 1 07:23 agentdebugoutput.txt |
-rw-r--r-- 1 root root 995383 Dec 1 07:23 agentdebugoutput4.txt |
-rw-r--r-- 1 root root 995383 Dec 1 07:23 agentdebugoutput3.txt |
-rw-r--r-- 1 root root 995383 Dec 1 07:23 agentdebugoutput2.txt |
[root@pepm reports]# cat ~/code/newtidy.pp |
class basic_tidy { |
tidy { 'delete-assessors': |
path => '/tmp/comply/assessors', |
age => '0', |
recurse => true, |
matches => [ 'agentdebugoutput*.txt' ], |
} |
}include basic_tidy |
[root@pepm reports]# puppet apply ~/code/newtidy.pp |
Notice: Compiled catalog for pepm.puppetdebug.vlan in environment production in 0.14 seconds |
Notice: Applied catalog in 0.30 seconds |
|