Filippo Giunchedi has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324820

Change subject: graphite: switch labs instances cleanup to cron
......................................................................

graphite: switch labs instances cleanup to cron

tmpreaper will run on each puppet run, that's not really feasible
because it'd take a long time to scan through all files. Switch to cron
+ find instead to be ran once a day.

Bug: T143405
Change-Id: Ia8c51dd440dc2e7f5adfac8fac5959fdbc0fa477
---
M modules/role/manifests/graphite/production.pp
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/20/324820/1

diff --git a/modules/role/manifests/graphite/production.pp 
b/modules/role/manifests/graphite/production.pp
index 05dc90f..9070dcc 100644
--- a/modules/role/manifests/graphite/production.pp
+++ b/modules/role/manifests/graphite/production.pp
@@ -28,9 +28,11 @@
     }
 
     # Cleanup stale labs instances data - T143405
-    tmpreaper::reap { 'graphite-labs-instances':
-        path => "${storage_dir}/instances",
-        age  => '90d',
+    cron { 'graphite-labs-instances':
+        command => "[ -d ${storage_dir}/whisper/instances ] && find 
${storage_dir}/whisper/instances -type f -mtime +90 -delete && find 
${storage_dir}/whisper/instances -type d -empty -delete",
+        user    => "_graphite",
+        hour    => "8",
+        minute  => fqdn_rand(60),
     }
 
     $graphite_hosts = [

-- 
To view, visit https://gerrit.wikimedia.org/r/324820
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia8c51dd440dc2e7f5adfac8fac5959fdbc0fa477
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi <fgiunch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to