X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fdebian_org%2Ftemplates%2Fpuppet-crontab.cron.erb;fp=modules%2Fdebian_org%2Ftemplates%2Fpuppet-crontab.cron.erb;h=a9d05b9d4287d34dea194dc8e59995a9b3183399;hb=168aa3f05f914802698b8db5fdde823c4e992913;hp=0000000000000000000000000000000000000000;hpb=f68bbdbf49bd867da963028b2691b93a94d4011d;p=mirror%2Fdsa-puppet.git diff --git a/modules/debian_org/templates/puppet-crontab.cron.erb b/modules/debian_org/templates/puppet-crontab.cron.erb new file mode 100644 index 000000000..a9d05b9d4 --- /dev/null +++ b/modules/debian_org/templates/puppet-crontab.cron.erb @@ -0,0 +1,19 @@ + +@hourly root [ ! -d /var/cache/dsa ] || touch /var/cache/dsa/cron.alive + +# run every 90 minutes +34 */3 * * * root if [ -x /usr/bin/puppet ]; then sleep $(( $RANDOM \% 2200 )); if [ -x /usr/bin/timeout ]; then TO="timeout --kill-after=900 2000"; else TO=""; fi; tmp="$(tempfile)"; egrep -v '^(#|$)' /etc/dsa/cron.ignore.puppet-crontab > "$tmp" && $TO /usr/bin/puppet agent --onetime --no-daemonize 2>&1 | egrep --text -v -f "$tmp"; rm -f "$tmp"; fi +4 1-23/3 * * * root if [ -x /usr/bin/puppet ]; then sleep $(( $RANDOM \% 2200 )); if [ -x /usr/bin/timeout ]; then TO="timeout --kill-after=900 2000"; else TO=""; fi; tmp="$(tempfile)"; egrep -v '^(#|$)' /etc/dsa/cron.ignore.puppet-crontab > "$tmp" && $TO /usr/bin/puppet agent --onetime --no-daemonize 2>&1 | egrep --text -v -f "$tmp"; rm -f "$tmp"; fi + +@hourly root sleep $(( $RANDOM \% 300 )); if [ -x /usr/lib/nagios/plugins/dsa-check-stunnel-sanity ] && [ -e /etc/stunnel/puppet-ekeyd.conf ] && ! /usr/lib/nagios/plugins/dsa-check-stunnel-sanity > /dev/null && grep -q '^client = yes' /etc/stunnel/puppet-ekeyd.conf; then /usr/sbin/service stunnel4 restart > /dev/null; fi + +@daily munin-async [ -d /var/lib/munin-async ] && find /var/lib/munin-async -maxdepth 1 -type f -mtime +30 -delete + +@daily root [ -d /var/lib/puppet/clientbucket ] && find /var/lib/puppet/clientbucket -type f -mtime +60 -delete && find /var/lib/puppet/clientbucket -type d -empty -delete + +@hourly root ! [ -x /usr/local/sbin/ntp-restart-if-required ] || /usr/local/sbin/ntp-restart-if-required + +# Nagios related entries +@hourly root [ -x /usr/sbin/dsa-update-apt-status ] && sleep $(( $RANDOM \% 1800 )) && /usr/sbin/dsa-update-apt-status 2>&1 | logger -t dsa-update-apt-status +13 */8 * * * root [ -x /usr/sbin/dsa-update-samhain-status ] && sleep $(( $RANDOM \% 27000 )) && /usr/sbin/dsa-update-samhain-status +40 12 25 * * root [ -x /usr/sbin/dsa-update-unowned-file-status ] && sleep $(( $RANDOM \% 86400 )) && /usr/sbin/dsa-update-unowned-file-status