JBAS-1832 Crontab updates to match production
authorBill Erickson <berickxx@gmail.com>
Wed, 16 Jan 2019 15:28:19 +0000 (10:28 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/utility-scripts/CRONTAB

index 7de991e..73e185f 100644 (file)
@@ -20,8 +20,12 @@ BACKSTAGE_PASSWORD = BSPASS
 # Uncomment on production to generate email alerts for certain actions
 # EG_UTIL_NOTIFY = 1 
 
-# hold targeter
-*/1 * * * *   . ~/.bashrc && $EG_BIN/hold_targeter.pl $SRF_CORE 2> /dev/null
+# NEW hold targeter / runs nightly
+# # 1. Wait 60 seconds between each parallel process runs its initial query
+# # 2. Consider a branch closed for targeting if it's closed now and 36 hours later (middle of day 2)
+# # 3. Retarget all holds last targeted 40+ hours ago
+# # 4. Refresh all holds targeted 16+ hours ago
+10 0 * * * . ~/.bashrc && $EG_BIN/hold_targeter_v2.pl --verbose --parallel 2 --parallel-init-sleep 60 --next-check-interval "36h" --retarget-interval "40h" --soft-retarget-interval "16h"
 
 # Recurring A/T event firing.  Runs every 2 minutes
 */2 * * * * . ~/.bashrc && $EG_BIN/action_trigger_runner.pl --osrf-config $SRF_CORE --run-pending
@@ -129,13 +133,18 @@ BACKSTAGE_PASSWORD = BSPASS
 # Update auth-2-auth links for new or modified authority records
 # 0 6 * * * . ~/.bashrc && cd $SCRIPT_DIR/../authority-control/linking && ./authority_authority_linker.pl --auth-mod-since $(date -d -1day +'\%F')
 
+
 # Backstage quarterly bib export                                               
-# Exports occur the second Friday of each quarter at noon.
+# # Exports occur the second Friday of each quarter at noon.
+# 0 6  8-14 1  * [ `date +\%u` = 5 ] && echo "Backstage Reminder" | mailx -s "Backstage Reminder" bserickson@kcls.org
 # 0 12 8-14 1  * [ `date +\%u` = 5 ] && cd $SCRIPT_DIR/../authority-control/backstage/ && ./backstage-agent.sh -d db05 -b
+# 0 6  8-14 4  * [ `date +\%u` = 5 ] && echo "Backstage Reminder" | mailx -s "Backstage Reminder" bserickson@kcls.org
 # 0 12 8-14 4  * [ `date +\%u` = 5 ] && cd $SCRIPT_DIR/../authority-control/backstage/ && ./backstage-agent.sh -d db05 -b
+# 0 6  8-14 7  * [ `date +\%u` = 5 ] && echo "Backstage Reminder" | mailx -s "Backstage Reminder" bserickson@kcls.org
 # 0 12 8-14 7  * [ `date +\%u` = 5 ] && cd $SCRIPT_DIR/../authority-control/backstage/ && ./backstage-agent.sh -d db05 -b
+# 0 6  8-14 10 * [ `date +\%u` = 5 ] && echo "Backstage Reminder" | mailx -s "Backstage Reminder" bserickson@kcls.org
 # 0 12 8-14 10 * [ `date +\%u` = 5 ] && cd $SCRIPT_DIR/../authority-control/backstage/ && ./backstage-agent.sh -d db05 -b
-#
+
 # Backstage authority record monthly updates                                   
 # Imports are available the 3rd Wednesday of every month.
 # 50 23 15-21 * * [ `date +\%u` = 3 ] && cd $SCRIPT_DIR/../authority-control/backstage/ && ./backstage-agent.sh -a
@@ -152,17 +161,10 @@ BACKSTAGE_PASSWORD = BSPASS
 # but are imported early on the 3rd Friday of every month.                     
 # 0 1 15-21 * * [ `date +\%u` = 5 ] && cd $SCRIPT_DIR/../authority-control/backstage/ && ./backstage-agent.sh -a
 
-# Anonymize a range of historical circs each night, with a maximum run
-# time of 120 minutes.  We split them up, because each range takes time
-# to run (~45 minutes). The first range starts at 2004-08-12, which is the
-# oldest xact_finish date in the database.  The last range brings us up 
-# to today - 6 months, which are the youngest circs we want to anonymize.
-#0 0 * * 1 cd $SCRIPT_DIR/purge_circs/ && ./purge_circulations.sh --start 2004-08-12 --end 2010-01-01 --increment "1 year" --duration 120 >> /openils/var/log/purge_circs.log
-#0 0 * * 2 cd $SCRIPT_DIR/purge_circs/ && ./purge_circulations.sh --start 2010-01-01 --end 2011-01-01 --increment "1 year" --duration 120 >> /openils/var/log/purge_circs.log
-#0 0 * * 3 cd $SCRIPT_DIR/purge_circs/ && ./purge_circulations.sh --start 2011-01-01 --end 2012-01-01 --increment "1 year" --duration 120 >> /openils/var/log/purge_circs.log
-#0 0 * * 4 cd $SCRIPT_DIR/purge_circs/ && ./purge_circulations.sh --start 2012-01-01 --end 2013-01-01 --increment "1 year" --duration 120 >> /openils/var/log/purge_circs.log
-#0 0 * * 5 cd $SCRIPT_DIR/purge_circs/ && ./purge_circulations.sh --start 2013-01-01 --end 2014-01-01 --increment "1 year" --duration 120 >> /openils/var/log/purge_circs.log
-#0 0 * * 6 cd $SCRIPT_DIR/purge_circs/ && ./purge_circulations.sh --start 2014-01-01 --end $(date -d -1year-1month +'\%F') --increment "1 year" --duration 120 >> /openils/var/log/purge_circs.log
+# Nightly circulation anonymization.  Stop processing at now - 1 year.
+# # At time of writing, the oldest xact_finish date is 2010-09-23 so we 
+# # start there (well, that month) each night.
+0 1 * * * cd $SCRIPT_DIR/purge_circs/ && bash purge_circulations.sh --start 2010-09-01 --end $(date -d -1year-1day +'\%F') --increment "3 months" --duration 90 >> /openils/var/log/purge_circs.log
 
 # Nightly holds purging
 30 1 * * * cd $SCRIPT_DIR/purge_holds/ && ./purge_holds.sh