From f58a54c44802c8298f10a86a0c9cae4c9f5d7795 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 18 Oct 2017 14:16:01 -0700 Subject: [PATCH] Logrotate track upstream logs There is currently a single 3.6GB track_upstream.log logfile on review.o.o. It has data from March 2017 through to today (October 2017). Lets rotate this logfile and keep 30 days worth of logs to reduce its impact on the local filesystem. Change-Id: Id80ab28b3c7dc9881ac28f55fa07aa539a11787d --- modules/openstack_project/manifests/gerrit.pp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/openstack_project/manifests/gerrit.pp b/modules/openstack_project/manifests/gerrit.pp index b43940b73d..d816442916 100644 --- a/modules/openstack_project/manifests/gerrit.pp +++ b/modules/openstack_project/manifests/gerrit.pp @@ -489,6 +489,19 @@ class openstack_project::gerrit ( ], require => Exec['manage_projects'], } + + logrotate::file { 'track_upstream.log': + log => '/var/log/track_upstream.log', + options => [ + 'compress', + 'missingok', + 'rotate 30', + 'daily', + 'notifempty', + 'copytruncate', + ], + require => Cron['track_upstream'], + } } } file { '/home/gerrit2/review_site/bin/set_agreements.sh':