Re: compress old puppet reports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 16, 2011 at 03:17:46PM -0600, Kevin Fenzi wrote:
> On Mon, 16 May 2011 16:55:27 -0400
> seth vidal <skvidal@xxxxxxxxxxxxxxxxx> 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
> > there.
> > 
> > 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
> > b/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/*`
> > +do 
> > + /bin/ls -1 $host/*.yaml | head --lines=-48 | xargs --no-run-if-empty
> > xz -9
> > +done
> > 
> > 
> > 
> > need two +1's please
> 
> +1. xz for the win. 
> 
+1

-Toshio

Attachment: pgpkGbjRTgTmK.pgp
Description: PGP signature

_______________________________________________
infrastructure mailing list
infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/infrastructure

[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux