Balasubramaniam Natarajan
2013-Jun-12 12:31 UTC
[Puppet Users] Tidy on puppet 2.7.18 not working
Hi I am trying to delete files which are older than a week under the directory "/var/lib/puppet/reports" on puppet master using tidy resource, however I cannot seem to get it working ? Any reason as to why this would happen ? root@WheezyMaster:/var/lib/puppet/reports# puppet -V 2.7.18 root@WheezyMaster:/var/lib/puppet/reports# cat /etc/puppet/manifests/tidy.pp tidy {delete_old_yaml: path => "/var/lib/puppet/reports", age => ''1w'', recurse => true, matches => ["*.yaml"], } root@WheezyMaster:/var/lib/puppet/reports# ls -ltrh wheezyagent.example.com/ total 736K -rw-r----- 1 puppet puppet 16K Apr 8 12:59 201304081659.yaml -rw-r----- 1 puppet puppet 15K Apr 8 13:01 201304081701.yaml -rw-r----- 1 puppet puppet 11K Apr 8 13:08 201304081708.yaml -rw-r----- 1 puppet puppet 11K Apr 8 13:09 201304081709.yaml -rw-r----- 1 puppet puppet 12K Apr 24 10:28 201304241428.yaml -rw-r----- 1 puppet puppet 14K Jun 11 09:23 201306111323.yaml -rw-r----- 1 puppet puppet 15K Jun 11 09:52 201306111352.yaml -rw-r----- 1 puppet puppet 33K Jun 11 10:06 201306111406.yaml -rw-r----- 1 puppet puppet 201K Jun 11 10:18 201306111418.yaml -rw-r----- 1 puppet puppet 72K Jun 11 10:28 201306111428.yaml -rw-r----- 1 puppet puppet 71K Jun 11 12:51 201306111651.yaml drwxr-xr-x 2 root root 4.0K Jun 12 07:33 old -rw-r----- 1 puppet puppet 68K Jun 12 07:34 201306121134.yaml -rw-r----- 1 puppet puppet 68K Jun 12 08:21 201306121221.yaml root@WheezyMaster:/var/lib/puppet/reports# puppet apply /etc/puppet/manifests/tidy.pp notice: Finished catalog run in 0.03 seconds root@WheezyMaster:/var/lib/puppet/reports# ls -ltrh wheezyagent.example.com/ total 736K *-rw-r----- 1 puppet puppet 16K Apr 8 12:59 201304081659.yaml -rw-r----- 1 puppet puppet 15K Apr 8 13:01 201304081701.yaml -rw-r----- 1 puppet puppet 11K Apr 8 13:08 201304081708.yaml -rw-r----- 1 puppet puppet 11K Apr 8 13:09 201304081709.yaml -rw-r----- 1 puppet puppet 12K Apr 24 10:28 201304241428.yaml* -rw-r----- 1 puppet puppet 14K Jun 11 09:23 201306111323.yaml -rw-r----- 1 puppet puppet 15K Jun 11 09:52 201306111352.yaml -rw-r----- 1 puppet puppet 33K Jun 11 10:06 201306111406.yaml -rw-r----- 1 puppet puppet 201K Jun 11 10:18 201306111418.yaml -rw-r----- 1 puppet puppet 72K Jun 11 10:28 201306111428.yaml -rw-r----- 1 puppet puppet 71K Jun 11 12:51 201306111651.yaml drwxr-xr-x 2 root root 4.0K Jun 12 07:33 old -rw-r----- 1 puppet puppet 68K Jun 12 07:34 201306121134.yaml -rw-r----- 1 puppet puppet 68K Jun 12 08:21 201306121221.yaml root@WheezyMaster:/var/lib/puppet/reports# -- Regards, Balasubramaniam Natarajan www.blog.etutorshop.com -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
http://docs.puppetlabs.com/references/latest/type.html#tidy The default is atime, maybe you could try mtime? tidy {delete_old_yaml: path => "/var/lib/puppet/reports", age => ''1w'', type => ''mtime'', recurse => true, matches => ["*.yaml"], } Your filesystem might be set to noatime - you can try find with the -mtime and -atime and see if there is a difference on what is returned. Den On Wed, Jun 12, 2013 at 10:31 PM, Balasubramaniam Natarajan < bala150985@gmail.com> wrote:> Hi > > I am trying to delete files which are older than a week under the > directory "/var/lib/puppet/reports" on puppet master using tidy resource, > however I cannot seem to get it working ? Any reason as to why this would > happen ? > > root@WheezyMaster:/var/lib/puppet/reports# puppet -V > 2.7.18 > root@WheezyMaster:/var/lib/puppet/reports# cat > /etc/puppet/manifests/tidy.pp > tidy {delete_old_yaml: > path => "/var/lib/puppet/reports", > age => ''1w'', > recurse => true, > matches => ["*.yaml"], > } > root@WheezyMaster:/var/lib/puppet/reports# ls -ltrh > wheezyagent.example.com/ > total 736K > -rw-r----- 1 puppet puppet 16K Apr 8 12:59 201304081659.yaml > -rw-r----- 1 puppet puppet 15K Apr 8 13:01 201304081701.yaml > -rw-r----- 1 puppet puppet 11K Apr 8 13:08 201304081708.yaml > -rw-r----- 1 puppet puppet 11K Apr 8 13:09 201304081709.yaml > -rw-r----- 1 puppet puppet 12K Apr 24 10:28 201304241428.yaml > -rw-r----- 1 puppet puppet 14K Jun 11 09:23 201306111323.yaml > -rw-r----- 1 puppet puppet 15K Jun 11 09:52 201306111352.yaml > -rw-r----- 1 puppet puppet 33K Jun 11 10:06 201306111406.yaml > -rw-r----- 1 puppet puppet 201K Jun 11 10:18 201306111418.yaml > -rw-r----- 1 puppet puppet 72K Jun 11 10:28 201306111428.yaml > -rw-r----- 1 puppet puppet 71K Jun 11 12:51 201306111651.yaml > drwxr-xr-x 2 root root 4.0K Jun 12 07:33 old > -rw-r----- 1 puppet puppet 68K Jun 12 07:34 201306121134.yaml > -rw-r----- 1 puppet puppet 68K Jun 12 08:21 201306121221.yaml > root@WheezyMaster:/var/lib/puppet/reports# puppet apply > /etc/puppet/manifests/tidy.pp > notice: Finished catalog run in 0.03 seconds > root@WheezyMaster:/var/lib/puppet/reports# ls -ltrh > wheezyagent.example.com/ > total 736K > *-rw-r----- 1 puppet puppet 16K Apr 8 12:59 201304081659.yaml > -rw-r----- 1 puppet puppet 15K Apr 8 13:01 201304081701.yaml > -rw-r----- 1 puppet puppet 11K Apr 8 13:08 201304081708.yaml > -rw-r----- 1 puppet puppet 11K Apr 8 13:09 201304081709.yaml > -rw-r----- 1 puppet puppet 12K Apr 24 10:28 201304241428.yaml* > -rw-r----- 1 puppet puppet 14K Jun 11 09:23 201306111323.yaml > -rw-r----- 1 puppet puppet 15K Jun 11 09:52 201306111352.yaml > -rw-r----- 1 puppet puppet 33K Jun 11 10:06 201306111406.yaml > -rw-r----- 1 puppet puppet 201K Jun 11 10:18 201306111418.yaml > -rw-r----- 1 puppet puppet 72K Jun 11 10:28 201306111428.yaml > -rw-r----- 1 puppet puppet 71K Jun 11 12:51 201306111651.yaml > drwxr-xr-x 2 root root 4.0K Jun 12 07:33 old > -rw-r----- 1 puppet puppet 68K Jun 12 07:34 201306121134.yaml > -rw-r----- 1 puppet puppet 68K Jun 12 08:21 201306121221.yaml > root@WheezyMaster:/var/lib/puppet/reports# > > > -- > Regards, > Balasubramaniam Natarajan > www.blog.etutorshop.com > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.