On 07/21/2011 08:08 AM, vagn scott wrote:
On 07/21/2011 03:14 AM, Hugo Deprez wrote:

Is there any mechanism available to auto delete old files ?
Or should I configured my own script to clean up old reports ?

I'm doing this:

class puppet::clean_reports {

        cron { "puppet clean reports":
command => 'cd /var/lib/puppet/reports && find . -type f -name \*.yaml -mtime +7 -print0 | xargs -0 -n50 /bin/rm -f',
          user => root,
          hour => 21,
          minute => 22,
          weekday => 0,
        }
}

If there's a better way I'd love to hear it.

Thinking about this some more, if you need the reports for dashboard to work,
then any cleanup script should  leave the latest report from any server,
so that, even if the server has not checked in for a while it won't disappear.

Thanks for the question.  Clearly I need to revisit this.

--
vagn

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to