From: erickson Date: Fri, 11 Dec 2009 22:04:55 +0000 (+0000) Subject: Patch from Joe Atzberger to build a file of sample crontab entries, w/ some modificat... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7481da37fbe435904b24a0881f093d084847d704;p=evergreen%2Fbjwebb.git Patch from Joe Atzberger to build a file of sample crontab entries, w/ some modifications to add Action/Trigger command. Thanks to Anoop Atre for the suggestion to add an entry for generate_circ_notices.pl git-svn-id: svn://svn.open-ils.org/ILS/trunk@15150 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/examples/crontab.example b/Open-ILS/examples/crontab.example new file mode 100644 index 000000000..a5abec051 --- /dev/null +++ b/Open-ILS/examples/crontab.example @@ -0,0 +1,76 @@ +# Evergreen crontab.example +# Author: Joe Atzberger, ESI +# Author: Bill Erickson, ESI +# +# This is an example of a crontab file for Debian. It may not work +# in other versions of crontab, like on Solaris 8 or BSD, for example. +# +# While similar in structure, +# this is NOT an example for cron (as root). Cron takes an extra +# argument per line to designate the user to run as. You could +# reasonably extrapolate the needed info from here though. +# +# WARNING: These jobs will do things like charge fines, send +# potentially VERY MANY emails to patrons and even debar offending +# users. DO NOT RUN OR SCHEDULE these jobs without being sure you +# really intend to. Make sure the relevant message templates are +# configured to your liking before scheduling messages to be sent. +# +# Except where indicated, these processes only need to run +# on 1 Evergreen server/brick. + + +# ENVIRONMENT: +# First, establish Evergreen ENV variables. +# +OPENILS = /openils +SRF_CORE = /openils/conf/opensrf_core.xml +EG_BIN_DIR = /openils/bin + +# crontab format: +# m h dom mon dow command + +# Run the hold targeter +* */4 * * * . ~/.bashrc && $EG_BIN_DIR/hold_targeter.pl $SRF_CORE + +# Run the hold thawer +5 0 * * * . ~/.bashrc && $EG_BIN_DIR/thaw_expired_frozen_holds.srfsh + +# Generate fines +30 0 * * * . ~/.bashrc && $EG_BIN_DIR/fine_generator.pl $SRF_CORE + +# Run the reshelving completer +2 0 * * * . ~/.bashrc && $EG_BIN_DIR/reshelving_complete.srfsh + +# create the list of blocked patrons for offline use +# Note: The resulting list.txt file needs to be copied to all Apache servers +30 6 * * * . ~/.bashrc && $EG_BIN_DIR/offline-blocked-list.pl $SRF_CORE > $OPENILS/var/web/standalone/list.txt + +# Restart SIP nightly to free up any orphaned processes. +# Note: Run on all SIP servers +# 5 2 * * * . ~/.bashrc && oils_ctl.sh -d $OPENILS/var/pid -s $OPENILS/conf/oils_sip.xml -a stop_sip +# 8 2 * * * . ~/.bashrc && oils_ctl.sh -d $OPENILS/var/pid -s $OPENILS/conf/oils_sip.xml -a start_sip + +# Action/Trigger entries ---- + +# Runs all pending A/T events every half hour +0 */2 * * * . ~/.bashrc && cd $EG_BIN_DIR && /usr/bin/perl ./action_trigger_runner.pl --osrf-config $SRF_CORE --run-pending + +# Passive A/T event generation. +# Note: the --granularity flag is not supported in 1.6 +# Note: passive event defs with no granularity will be processed regardless of any granularity flags +# Note: push these back to 3am so they will run after the fine generator and spread out the start minute to reduce dogpiling +0 * * * * . ~/.bashrc && cd $EG_BIN_DIR && /usr/bin/perl ./action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity hourly +5 3 * * * . ~/.bashrc && cd $EG_BIN_DIR && /usr/bin/perl ./action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity daily +10 3 * * 1-5 . ~/.bashrc && cd $EG_BIN_DIR && /usr/bin/perl ./action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity weekdays +15 3 * * 0 . ~/.bashrc && cd $EG_BIN_DIR && /usr/bin/perl ./action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity weekly +20 3 1 * * . ~/.bashrc && cd $EG_BIN_DIR && /usr/bin/perl ./action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity monthly +25 3 1 1 * . ~/.bashrc && cd $EG_BIN_DIR && /usr/bin/perl ./action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity yearly + +# Legacy overdue/predue notice generator. Change to suit. +#XML_FILE_PREFIX = /openils/var/data/overdue/overdue +#0 3 * * * . ~/.bashrc && cd $EG_BIN_DIR && /usr/bin/perl ./generate_circ_notices.pl --osrf_config $SRF_CORE --notice-types overdue,predue --generate-global-templates --send-email > $XML_FILE_PREFIX.$(date +"\%F").xml + + +# TODO: add other entries +