From: Steven Baltakatei Sandoval Date: Wed, 1 Jul 2020 21:42:21 +0000 (+0000) Subject: fix(bkgpslog):Fix output files having the same names X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02.git/commitdiff_plain/29ef133a0e3322a657756f0d14a233e2cf091965?ds=inline;hp=-c fix(bkgpslog):Fix output files having the same names --- 29ef133a0e3322a657756f0d14a233e2cf091965 diff --git a/exec/bkgpslog b/exec/bkgpslog index 6995f86..d447886 100755 --- a/exec/bkgpslog +++ b/exec/bkgpslog @@ -727,10 +727,10 @@ main() { # Record gps data until script lifespan ends declare debugCounter; debugCounter="0"; # set debug counter - timeStart=$(dateTimeShort); # Note start time while [[ "$SECONDS" -lt "$scriptTTL" ]]; do + timeBufferStart="$(dateTimeShort)"; # Note start time # Determine file paths (time is start of buffer period) - FILEOUT_BASENAME="$timeStart""--""$bufferTTL_STR""..""$SCRIPT_HOSTNAME""_location" && vbm "STATUS:Set FILEOUT_BASENAME to:$FILEOUT_BASENAME"; + FILEOUT_BASENAME="$timeBufferStart""--""$bufferTTL_STR""..""$SCRIPT_HOSTNAME""_location" && vbm "STATUS:Set FILEOUT_BASENAME to:$FILEOUT_BASENAME"; ## Files saved to DIR_TMP PATHOUT_NMEA="$DIR_TMP"/"$FILEOUT_BASENAME".nmea"$CMD_COMPRESS_SUFFIX""$CMD_ENCRYPT_SUFFIX" && vbm "STATUS:Set PATHOUT_NMEA to:$PATHOUT_NMEA"; PATHOUT_GPX="$DIR_TMP"/"$FILEOUT_BASENAME".gpx"$CMD_COMPRESS_SUFFIX""$CMD_ENCRYPT_SUFFIX" && vbm "STATUS:Set PATHOUT_GPX to:$PATHOUT_GPX"; @@ -765,7 +765,7 @@ main() { # Remove secured chunks from DIR_TMP try rm "$PATHOUT_NMEA" "$PATHOUT_GPX" "$PATHOUT_KML"; # Reset buffer and filenames - unset bufferBash FILEOUT_BASENAME PATHOUT_NMEA PATHOUT_GPX PATHOUT_KML PATHOUT_TAR; + unset bufferBash FILEOUT_BASENAME PATHOUT_NMEA PATHOUT_GPX PATHOUT_KML PATHOUT_TAR timeBufferStart; vbm "DEBUG:Completed buffer session $debugCounter ." 1>&2; ((debugCounter++)) done