From d3ac8bb6f8899d13e6725c3a780ee810179426c7 Mon Sep 17 00:00:00 2001 From: jeremysherriff Date: Fri, 19 Oct 2018 18:21:11 +1300 Subject: [PATCH] Silence updateGravity job unless errors occur No need for append/logrotate as we are only interested in the latest output Signed-off-by: jeremysherriff --- advanced/Templates/pihole.cron | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/advanced/Templates/pihole.cron b/advanced/Templates/pihole.cron index 02a63b74..8dc98721 100644 --- a/advanced/Templates/pihole.cron +++ b/advanced/Templates/pihole.cron @@ -16,7 +16,9 @@ # Pi-hole: Update the ad sources once a week on Sunday at a random time in the # early morning. Download any updates from the adlists -59 1 * * 7 root PATH="$PATH:/usr/local/bin/" pihole updateGravity +# Squash output to log, then splat the log to stdout on error to allow for +# standard crontab job error handling. +59 1 * * 7 root PATH="$PATH:/usr/local/bin/" pihole updateGravity >/var/log/pihole_updateGravity.log || cat /var/log/pihole_updateGravity.log # Pi-hole: Flush the log daily at 00:00 # The flush script will use logrotate if available