X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/3329584b8848c977d0d05bf6757cf4ecb812efe3..refs/heads/develop:/user/bkots?ds=sidebyside diff --git a/user/bkots b/user/bkots index 3c9705c..8d6ecde 100755 --- a/user/bkots +++ b/user/bkots @@ -1,8 +1,13 @@ #!/usr/bin/env bash +# Desc: Recursively timestamp files with OpenTimestamp +# Usage: bkots [PATH] +# Version: 0.2.0 # Define variables declare -g max_job_count="2"; # default max job count declare -g age_threshold="60"; # min age to add file; seconds; +declare -g stamp_throttle="0.1"; # seconds delay between stamps +declare -g stamp_throttle_fail="1"; # seconds delay if stamp errors declare -Ag appRollCall # Associative array for storing app status declare -Ag fileRollCall # Associative array for storing file status declare -Ag dirRollCall # Associative array for storing dir status @@ -757,7 +762,13 @@ main() { if [[ "$opVerbose" = "true" ]]; then declare -p cmd_temp; fi; #### execute command - "${cmd_temp[@]}"; + if "${cmd_temp[@]}"; then + sleep "$stamp_throttle" || die "FATAL:Invalid stamp throttle."; + else + yell "ERROR:Could not stamp file with command:$(declare -p cmd_temp)"; + sleep "$stamp_throttle_fail" || die "FATAL:Invalid stamp throttle."; + fi; + unset cmd_temp; #ots stamp "$path_src"; else