X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fmunin%2Ffiles%2Fmaster-cleanup-cron;h=a55cc262213166e96371fb652d1543090c7ded43;hb=ddcd7c5ea5a1c13516637229ca6d6270559a87cf;hp=883998a8dfb0ce6265c3ac103a39302f6581de41;hpb=4bbb026dd9e39444192456c5f248a791a25954b4;p=mirror%2Fdsa-puppet.git diff --git a/modules/munin/files/master-cleanup-cron b/modules/munin/files/master-cleanup-cron index 883998a8d..a55cc2622 100644 --- a/modules/munin/files/master-cleanup-cron +++ b/modules/munin/files/master-cleanup-cron @@ -5,5 +5,7 @@ MAILTO=root @daily munin find /var/lib/munin -maxdepth 1 -type f -name 'state-*' -mtime +90 -delete @daily munin find /var/lib/munin/debian.org -maxdepth 1 -type f -mtime +90 -delete -@daily www-data find /var/lib/munin/cgi-tmp -type f -mtime +10 -delete -@daily www-data find /var/lib/munin/cgi-tmp -mindepth 2 -type d -empty -delete +@daily www-data find /var/lib/munin/cgi-tmp -type f -mtime +10 -delete ; find /var/lib/munin/cgi-tmp -mindepth 2 -type d -empty -delete + +# kill munin-update jobs older than 2 hours +@hourly munin ps h -eo pid,etimes,user,args | perl -a -e '($pid,$age,$user,@cmd) = @F; $cmd = join(" ", @cmd); next if ($user ne "munin" or $cmd !~ "munin-update" or $age <= 2*3600); kill("TERM", $pid)'