From: Steven Baltakatei Sandoval Date: Tue, 7 Jul 2020 23:59:56 +0000 (+0000) Subject: fix(bkgpslog):Recreate working dir if missing X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02.git/commitdiff_plain/dff670198ebafee7b4a4b40ec816c929683e9209?ds=inline fix(bkgpslog):Recreate working dir if missing --- diff --git a/exec/bkgpslog b/exec/bkgpslog index 0309059..58b0465 100755 --- a/exec/bkgpslog +++ b/exec/bkgpslog @@ -1313,10 +1313,10 @@ main() { ## Note: SCRIPT_TTL_TE is time element string (ex: "day") while SCRIPT_TTL is integer seconds # File name substring (ISO-8601 duration from BUFFER_TTL) - bufferTTL_STR="$(timeDuration "$BUFFER_TTL")"; + bufferTTL_STR="$(timeDuration "$BUFFER_TTL")" && vbm "DEBUG:bufferTTL_STR:$bufferTTL_STR"; # Init temp working dir - try mkdir "$DIR_TMP" && chmod +t "$DIR_TMP" && vbm "DEBUG:Working dir creatd at:$DIR_TMP"; + try mkdir "$DIR_TMP" && vbm "DEBUG:Working dir created at DIR_TMP:$DIR_TMP"; # Initialize 'tar' archive ## Define output tar path (note: each day gets *one* tar file (Ex: "20200731..hostname_location.[.gpx.gz].tar")) @@ -1335,6 +1335,7 @@ main() { # MAIN LOOP:Record gps data until script lifespan ends timeBufferFirstNS="$(timeEpochNS)"; bufferRound=0; BUFFER_TTL_ADJ_FLOAT="$BUFFER_TTL"; while [[ "$SECONDS" -lt "$SCRIPT_TTL" ]]; do + if ! [[ -d "$DIR_TMP" ]]; then yell "ERROR:DIR_TMP existence failure:$DIR_TMP"; try mkdir "$DIR_TMP" && vbm "DEBUG:Working dir recreated DIR_TMP:$DIR_TMP"; fi magicParseRecipientDir; magicGatherWriteBuffer & sleep "$BUFFER_TTL_ADJ_FLOAT"; # adjusted by magicBufferSleepPID