From: Steven Baltakatei Sandoval Date: Mon, 6 Jul 2020 19:47:03 +0000 (+0000) Subject: fix(bkgpslog):Actually add recipient watch dir check X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02.git/commitdiff_plain/1a1738c494ed3fad751cf395aa4d4b493e61f7eb fix(bkgpslog):Actually add recipient watch dir check --- diff --git a/exec/bkgpslog b/exec/bkgpslog index 3e8d69f..bc58c45 100755 --- a/exec/bkgpslog +++ b/exec/bkgpslog @@ -14,7 +14,7 @@ DIR_TMP_DEFAULT="/dev/shm"; # Default parent of working directory SCRIPT_TIME_START=$(date +%Y%m%dT%H%M%S.%N); PATH="$HOME/.local/bin:$PATH"; # Add "$(systemd-path user-binaries)" path in case apps saved there SCRIPT_HOSTNAME=$(hostname); # Save hostname of system running this script. -SCRIPT_VERSION="0.4.0"; # Define version of script. +SCRIPT_VERSION="0.4.1"; # Define version of script. SCRIPT_NAME="bkgpslog"; # Define basename of script file. SCRIPT_URL="https://gitlab.com/baltakatei/ninfacyzga-01"; # Define wesite hosting this script. AGE_VERSION="1.0.0-beta2"; # Define version of age (encryption program) @@ -1201,6 +1201,7 @@ main() { # MAIN LOOP:Record gps data until script lifespan ends while [[ "$SECONDS" -lt "$SCRIPT_TTL" ]]; do + magicParseRecipientDir magicGatherWriteBuffer & sleep "$BUFFER_TTL"; done diff --git a/exec/bkgpslog-plan.org b/exec/bkgpslog-plan.org index 3e43633..e100962 100644 --- a/exec/bkgpslog-plan.org +++ b/exec/bkgpslog-plan.org @@ -222,6 +222,23 @@ think converting ~bkgpslog~ into a ~bklog~ script that appends encrypted and compressed data to a tar file for later extraction (possibly the same script with future features) would be best. +** TODO: Place persistent recip. updates in asynchronous coproc +2020-07-06T19:37Z; bktei> In order to update the recipient list, the +magicParseRecipientDir() function needs to be run each buffer period +in order to scan for changes in the recipient list. However, such a +scan takes time; if the magicGatherWriteBuffer() function must pause +until magicParseRecipientDir() completes, then a significant pause +between buffer sessions may occur, causing detectable gaps in location +data between buffer rounds. + +I looked for ways in which I might start magicParseRecipientDir() +asynchronously immediately before running the data collection command +and then collect its output at the start of the next buffer round. One +way using the ~coproc~ Bash built-in is described [[https://stackoverflow.com/a/20018504/10850071][here]]. I'd have to +make the asynchronous function output the recipient list to stdout +which would then be ~read~ into the ~recPubKeysValid~ array in the +main loop. However, for now, I'm putting the magicParseRecipientDir() +as-is in the main loop and accepting the delay for now. * bkgpslog narrative ** Initialize environment *** Init variables