From: Don Armstrong Date: Mon, 2 Mar 2009 01:53:48 +0000 (+0000) Subject: * report a failed update once a day X-Git-Url: https://git.donarmstrong.com/?p=spamassassin_config.git;a=commitdiff_plain;h=6e4f0a7707f8291ebfed167598b86f68f9d8e9e5 * report a failed update once a day git-svn-id: svn+ssh://svn.debian.org/svn/pkg-listmaster/trunk/spamassassin_config@293 0b7a5b0c-1f2c-0410-bd74-c376f8064c91 --- diff --git a/update_spamassassin b/update_spamassassin index 1769913..3ffa065 100755 --- a/update_spamassassin +++ b/update_spamassassin @@ -48,17 +48,18 @@ trap remove_pidfile ERR; FAILUREMESSAGE=""; function report_failure(){ # Hrm; a previous update failed; don't report again until the file - # is removed - if [ -e "$SACONFIG/failed_update" ]; then + # is removed or it's more than a day old + if [ -e "$SACONFIG/failed_update" ] && + [ $(($(date +%s) - $(stat -c '%Y' "$SACONFIG/failed_update"))) -lt 86400 ]; then rm -rf "$TMPDIR" exit 0; fi; - echo "$FAILUREMESSAGE" >> "$SACONFIG/failed_update" + echo "$FAILUREMESSAGE" > "$SACONFIG/failed_update" echo "$FAILUREMESSAGE"; cat - <