How Can I Clean Up Reporting Disk Space Usage?

Sean Horn -

In a previous knowledge base article, https://getchef.zendesk.com/hc/en-us/articles/204950814, we talked about how to control the retention of data in the Analytics product.

Chef Reporting has the same issue, but in the 1.3 version, has a built-in way to cleanup, which we detail in this blog post https://www.chef.io/blog/2015/03/30/chef-reporting-1-3-0-released/

We can take that one step further with the following cronjob on a Chef Server.

cat<<'EOF' > /etc/cron.weekly/chef-reporting.cron
#!/bin/sh

log='/var/log/opscode-reporting/cull.log'

echo "[$(date)] Deleting Chef Reporting events older than 1 month" >> $log

opscode-reporting-ctl remove-partitions --before $(date '+%Y-%m') &>> $log 

echo >> $log

exit 0

EOF  
chmod +x /etc/cron.weekly/chef-reporting.cron
Have more questions? Submit a request

Comments

Powered by Zendesk