kill munin-update jobs older than 2 hours
authorPeter Palfrader <peter@palfrader.org>
Sat, 26 Nov 2016 13:23:43 +0000 (14:23 +0100)
committerPeter Palfrader <peter@palfrader.org>
Sat, 26 Nov 2016 13:23:43 +0000 (14:23 +0100)
modules/munin/files/master-cleanup-cron

index 7092b4b..a55cc26 100644 (file)
@@ -6,3 +6,6 @@ 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 ; 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)'