debug(bklog):Add debug msgs to write function
authorSteven Baltakatei Sandoval <baltakatei@gmail.com>
Sat, 11 Jul 2020 04:58:57 +0000 (04:58 +0000)
committerSteven Baltakatei Sandoval <baltakatei@gmail.com>
Sat, 11 Jul 2020 04:58:57 +0000 (04:58 +0000)
exec/bklog

index ad75022bf4326ec597995a7ab3d0357c7fe95260..6493015e80bcd5a314211a76ff21c8f88a055e8e 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.12";          # Define version of script.
+scriptVersion="0.1.13";          # 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.
@@ -1262,19 +1262,21 @@ magicProcessWriteBuffer() {
     
     ## Process buffer and write to dir_tmp
     for index in "${!pathouts[@]}"; do
-       writeCmd2="${procStrings[$index]}"
-       eval "$writeCmd1 | $writeCmd2 | $writeCmd3 | $writeCmd4" >> "${pathouts[$index]}";
+       writeCmd2="${procStrings[$index]}";
+       writeCmdAll="$writeCmd1 | $writeCmd2 | $writeCmd3 | $writeCmd4" && vbm "STATUS:$fn:Assembled command:\"$writeCmdAll\"";
+       eval "$writeCmdAll" >> "${pathouts[$index]}" && vbm "STATUS:$fn:Wrote command output to ${pathouts[$index]}";
     done;
     
     # Append dir_tmp files to pathout_tar
     wait; # Wait to avoid collision with older magicProcessWriteBuffer() instances (see https://www.tldp.org/LDP/abs/html/x9644.html )
     for index in "${!pathouts[@]}"; do
-       appendFileTar "${pathouts[$index]}" "${fileouts[$index]}" "$pathout_tar" "$dir_tmp";
+       appendFileTar "${pathouts[$index]}" "${fileouts[$index]}" "$pathout_tar" "$dir_tmp" && \
+           vbm "STATUS:$fn:Appended ${pathouts[$index]} to $pathout_tar";
     done;
     
     # Remove secured chunks from dir_tmp
     for path in "${pathouts[@]}"; do
-       rm "$path";
+       rm "$path" && vbm "STATUS:$fn:Removed:$path";
     done;
     
     vbm "STATUS:$fn:Finished magicProcessWriteBuffer().";