compress old puppet reports
kevin at scrye.com
Mon May 16 21:17:46 UTC 2011
On Mon, 16 May 2011 16:55:27 -0400
seth vidal <skvidal at fedoraproject.org> wrote:
> Puppet reports have grown since we switched from 0.25 to 2.6.X by
> roughly 10x their original size.
> so they are sucking the disk space out of puppet1 b/c we keep them
> When I reduced the number we keep it didn't have as nice of an impact
> on our free space as I would like.
> So - I wrote this to modify our reports clean up to compress all .yaml
> files except for the latest 24hours worth of them.
> It keeps 1month present - but much, much, smaller
> and it keeps the latest 24 hours worth immediately available.
> here's the patch:
> diff --git a/modules/puppet/files/puppet-report-clean.sh
> index d274e2b..d4af330 100755
> --- a/modules/puppet/files/puppet-report-clean.sh
> +++ b/modules/puppet/files/puppet-report-clean.sh
> @@ -2,3 +2,11 @@
> # clean up all but the last 1 month of puppet reports
> /usr/sbin/tmpwatch --mtime 720 /var/lib/puppet/reports/
> +# compress all the .yaml files per host dir, except for the latest 24
> hours worth.
> +# since they are txt files and compress really well
> +for host in `echo /var/lib/puppet/reports/*`
> + /bin/ls -1 $host/*.yaml | head --lines=-48 | xargs --no-run-if-empty
> xz -9
> need two +1's please
+1. xz for the win.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/infrastructure/attachments/20110516/2f7a2176/attachment.bin
More information about the infrastructure