From 86e371e6312160b44c876c8fa4e9dec510ab9ee2 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 18 Sep 2012 22:12:13 +0000 Subject: [PATCH] Add cron job to compress jenkins logs. Change-Id: I104d7aa9f2fd2fc0b04e0541c9120c4ee15693e0 Reviewed-on: https://review.openstack.org/13234 Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins --- modules/openstack_project/manifests/static.pp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/openstack_project/manifests/static.pp b/modules/openstack_project/manifests/static.pp index c71a0996f8..941682c84f 100644 --- a/modules/openstack_project/manifests/static.pp +++ b/modules/openstack_project/manifests/static.pp @@ -52,4 +52,11 @@ class openstack_project::static ( ensure => directory } + cron { "gziplogs": + user => root, + hour => "*/6", + command => 'sleep $((RANDOM\%600)) && flock -n /var/run/gziplogs.lock find /srv/static/logs/ \( -name \*.txt -or -name \*.html \) -exec gzip \{\} \;', + environment => "PATH=/var/lib/gems/1.8/bin:/usr/bin:/bin:/usr/sbin:/sbin", + } + }