Add more message-based tracing to log01 scripts
This commit is contained in:
parent
805599baeb
commit
db936062b3
7 changed files with 69 additions and 1 deletions
|
@ -25,6 +25,8 @@
|
|||
# we are 5 days behind.
|
||||
|
||||
# We have dropped this down to 3 days on 2019-10-01
|
||||
RUN_ID="$(uuidgen -r)"
|
||||
simple_message_to_bus condense-mirrorlogs.start run_id="$RUN_ID"
|
||||
|
||||
let NUMDAYS=3
|
||||
let OLDDAYS=$(( $NUMDAYS+1 ))
|
||||
|
@ -71,7 +73,9 @@ if [[ ! -f ${LOGFILE} ]]; then
|
|||
elif [[ -f ${WORKFILE} ]]; then
|
||||
echo "The workfile for ${YEAR}/${MONTH}/${DAY} already existed."
|
||||
else
|
||||
simple_message_to_bus condense-mirrorlogs.mirrorlist.start run_id="$RUN_ID" workfile="$WORKFILE" logfile="$LOGFILE"
|
||||
${LBIN}/mirrorlist.py -o ${WORKFILE} ${LOGFILE};
|
||||
simple_message_to_bus condense-mirrorlogs.mirrorlist.finish run_id="$RUN_ID" workfile="$WORKFILE" logfile="$LOGFILE" result="$?"
|
||||
fi
|
||||
|
||||
# So the data isn't strictly across month boundries due to the end of
|
||||
|
@ -106,3 +110,4 @@ gnuplot ${LSHARE}/${PROJECT}-data.gp
|
|||
|
||||
# cleanup the temp data
|
||||
rm -rf ${TEMPDIR}
|
||||
simple_message_to_bus condense-mirrorlogs.finish run_id="$RUN_ID"
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
RUN_ID="$(uuidgen -r)"
|
||||
simple_message_to_bus countme-update.start run_id="$RUN_ID"
|
||||
|
||||
# Where do we keep our local/internal data?
|
||||
LOCAL_DATA_DIR=/var/lib/countme
|
||||
RAW_DB=$LOCAL_DATA_DIR/raw.db
|
||||
|
@ -31,7 +34,15 @@ die() { echo "${0##*/}: error: $*" >&2; exit 2; }
|
|||
# _run [COMMAND...]: Run a command, honoring $VERBOSE and $DRYRUN
|
||||
_run() {
|
||||
if [ "$VERBOSE" -o "$DRYRUN" ]; then echo "$@"; fi
|
||||
if [ "$DRYRUN" ]; then return 0; else "$@"; fi
|
||||
if [ "$DRYRUN" ]; then
|
||||
return 0
|
||||
else
|
||||
simple_message_to_bus countme-update.command.start run_id="$RUN_ID" command="$@"
|
||||
"$@"
|
||||
RESULT=$?
|
||||
simple_message_to_bus countme-update.command.finish run_id="$RUN_ID" command="$@" result="$?"
|
||||
return $RESULT
|
||||
fi
|
||||
}
|
||||
|
||||
# CLI help text
|
||||
|
@ -108,3 +119,6 @@ _run $_GIT diff --quiet || _run $_GIT commit -a -m "$(date -u +%F) update"
|
|||
# Copy new data into place
|
||||
_run atomic_copy $TOTALS_DB $PUBLIC_TOTALS_DB
|
||||
_run atomic_copy $TOTALS_CSV $PUBLIC_TOTALS_CSV
|
||||
|
||||
simple_message_to_bus countme-update.finish run_id="$RUN_ID"
|
||||
|
||||
|
|
|
@ -140,6 +140,12 @@
|
|||
tags:
|
||||
- web-data
|
||||
|
||||
- name: install messaging script for our improvized tracing
|
||||
copy: src=simple_message_to_bus dest=/usr/local/bin/ mode=0755
|
||||
tags:
|
||||
- web-data
|
||||
- cron
|
||||
|
||||
- name: install countme script to parse new logs & update totals
|
||||
copy: src=countme-update.sh dest=/usr/local/bin/ mode=0755
|
||||
tags:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue