From: Bill Erickson Date: Mon, 23 Oct 2017 17:57:22 +0000 (-0400) Subject: JBAS-1764 A/T purge CRON script X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d1a517862951d5761c4c4af601b5f8f41a0c6d51;p=working%2FEvergreen.git JBAS-1764 A/T purge CRON script Signed-off-by: Bill Erickson --- diff --git a/KCLS/utility-scripts/CRONTAB b/KCLS/utility-scripts/CRONTAB index 77ca08d603..133070c9e8 100644 --- a/KCLS/utility-scripts/CRONTAB +++ b/KCLS/utility-scripts/CRONTAB @@ -163,6 +163,9 @@ BACKSTAGE_PASSWORD = BSPASS # Nightly holds purging 30 1 * * * cd $SCRIPT_DIR/purge_holds/ && ./purge_holds.sh +# Nightly Action/Trigger purging +30 2 * * * cd $SCRIPT_DIR/purge_action_trigger/ && ./purge_action_trigger.sh + # Process and archive student import files each Sunday night at 11pm # 0 23 * * 0 cd /home/opensrf/Evergreen/KCLS/utility-scripts/import_students && ./sftp-client-agent.sh -b db01 -p -a diff --git a/KCLS/utility-scripts/purge_action_trigger/purge_action_trigger.sh b/KCLS/utility-scripts/purge_action_trigger/purge_action_trigger.sh new file mode 100755 index 0000000000..053ae72f3f --- /dev/null +++ b/KCLS/utility-scripts/purge_action_trigger/purge_action_trigger.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# Kick off the Action/Trigger purge function. +# Set PGHOST, PGPASSWORD, PGUSER environment variables! +set -eu +PSQL="psql" + +echo -n "Purging A/T at " +date +"%F %T" + +echo "SET STATEMENT_TIMEOUT = 0; SELECT action_trigger.purge_events();" | $PSQL; + +echo -n "Purging A/T complete at " +date +"%F %T"