Signed-off-by: Bill Erickson <berickxx@gmail.com>
# 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
--- /dev/null
+#!/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"