# Script Metadata
scriptName="bklog"; # Define basename of script file.
-scriptVersion="0.1.23"; # Define version of script.
+scriptVersion="0.1.24"; # 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.
if tar --list --file="$pathTar" 1>/dev/null 2>&1; then
## T1: return success
returnFlag0="tar valid";
+ elif { sleep 2; tar --list --file="$pathTar" 1>/dev/null 2>&1; }; then
+ ## F1: Check tar archive again after 2-second sleep
+ returnFlag0="tar valid";
else
- ## F1: Check if file exists
+ ## F2-1: Check if file exists
if [[ -f "$pathTar" ]]; then
### T: Rename file
- try mv "$pathTar" "$pathTar""--broken--""$(date +%Y%m%dT%H%M%S)" && \
+ try mv "$pathTar" "$pathTar""--broken--""$(date +%Y%m%dT%H%M%S%z)" && \
returnFlag1="tar moved";
else
### F: -
:
fi;
- ## F2: Create tar archive, return 0
+ ## F2-1: Create tar archive, return 0
try tar --create --file="$pathTar" --files-from=/dev/null && \
returnFlag2="tar created";
fi;