debug(bklog):Fix SECONDS advancing
authorSteven Baltakatei Sandoval <baltakatei@gmail.com>
Tue, 14 Jul 2020 02:44:05 +0000 (02:44 +0000)
committerSteven Baltakatei Sandoval <baltakatei@gmail.com>
Tue, 14 Jul 2020 02:44:05 +0000 (02:44 +0000)
exec/bklog

index 188910dbe89cd77b22eb9307c72e2fe95618871d..45e6996a2f596db7810692c6d1264bf8527d47c1 100644 (file)
@@ -11,7 +11,7 @@ dirTmpDefault="/dev/shm"; # Default parent of working directory
 
 # Script Metadata
 scriptName="bklog";             # Define basename of script file.
-scriptVersion="0.1.26";          # Define version of script.
+scriptVersion="0.1.27";          # Define version of script.
 scriptURL="https://gitlab.com/baltakatei/ninfacyzga-01"; # Define wesite hosting this script.
 scriptTimeStart="$(date +%Y%m%dT%H%M%S.%N)"; # YYYYmmddTHHMMSS.NNNNNNNNN
 scriptHostname=$(hostname);     # Save hostname of system running this script.
@@ -1410,7 +1410,7 @@ main() {
     ### Advance SECONDS the remainder seconds for dividend timeUntilNextDay, divisor bufferTTL
     if [[ "$(timeUntilNextDay)" -gt "$bufferTTL" ]]; then
        vbm "DEBUG :$fn:SECONDS currently  :$SECONDS";
-       SECONDS="$(( $(timeUntilNextDay) % bufferTTL ))" && \
+       SECONDS="$(( bufferTTL - ($(timeUntilNextDay) % bufferTTL) ))" && \
            vbm "DEBUG :$fn:SECONDS advanced to:$SECONDS";
        vbm "DEBUG :$fn:current time:$(date --iso-8601=seconds)";
     fi;