## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables
## Example of parallel execution of four commands, only if directories exist. Warn if execution takes more than 300 seconds. Stop if takes longer than 900 seconds. Exeute max 3 commands in parallel.
localmainInput="${1}"# Contains list of pids / commands separated by semicolons or filepath to list of pids / commands
# Optional arguments
localid="${2:-base}"# Optional ID in order to identify global variables from this run (only bash variable names, no '-'). Global variables are WAIT_FOR_TASK_COMPLETION_$id and HARD_MAX_EXEC_TIME_REACHED_$id
localid="${2:-(undisclosed)}"# Optional ID in order to identify global variables from this run (only bash variable names, no '-'). Global variables are WAIT_FOR_TASK_COMPLETION_$id and HARD_MAX_EXEC_TIME_REACHED_$id
localreadFromFile="${3:-false}"# Is mainInput / auxInput a semicolon separated list (true) or a filepath (false)
localsoftPerProcessTime="${4:-0}"# Max time (in seconds) a pid or command can run before a warning is logged, unless set to 0
localhardPerProcessTime="${5:-0}"# Max time (in seconds) a pid or command can run before the given command / pid is stopped, unless set to 0
@ -972,7 +972,7 @@ function ExecTasks {
fi
if[$functionMode=="WaitForTaskCompletion"];then
# Force first while loop condition to be true because we don't deal with counters but pids in WaitForTaskCompletion mode
# Force first while loop condition to be true because we do not deal with counters but pids in WaitForTaskCompletion mode
counter=$mainItemCount
fi
@ -999,7 +999,7 @@ function ExecTasks {
if[$log_ttime -ne $exec_time];then# Fix when sleep time lower than 1 second
log_ttime=$exec_time
if[$functionMode=="WaitForTaskCompletion"];then
Logger "Current tasks still running with pids [$(joinString , ${pidsArray[@]})].""NOTICE"
Logger "Current tasks ID=$idstill running with pids [$(joinString , ${pidsArray[@]})].""NOTICE"
elif[$functionMode=="ParallelExec"];then
Logger "There are $((mainItemCount-counter+postponedItemCount)) / $mainItemCount tasks in the queue of which $postponedItemCount are postponed. Currently, ${#pidsArray[@]} tasks running with pids [$(joinString , ${pidsArray[@]})].""NOTICE"
fi
@ -1057,7 +1057,7 @@ function ExecTasks {
pidState="$(eval$PROCESS_STATE_CMD)"
if["$pidState" !="D"]&&["$pidState" !="Z"];then
# Check if pid hasn't run more than soft/hard perProcessTime
# Check if pid has not run more than soft/hard perProcessTime
Logger "No directories available to watch.""CRITICAL"
fi
}
#### InotifyWaitPoller SUBSET END ####
# If using "include" statements, make sure the script does not get executed unless it's loaded by bootstrap.sh which will replace includes with actual code
_OFUNCTIONS_BOOTSTRAP=true
["$_OFUNCTIONS_BOOTSTRAP" !=true]&&echo"Please use bootstrap.sh to load this dev version of $(basename $0) or build it with merge.sh"&&exit1
@ -2795,7 +2950,7 @@ else
fi
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables
## Example of parallel execution of four commands, only if directories exist. Warn if execution takes more than 300 seconds. Stop if takes longer than 900 seconds. Exeute max 3 commands in parallel.
localmainInput="${1}"# Contains list of pids / commands separated by semicolons or filepath to list of pids / commands
# Optional arguments
localid="${2:-base}"# Optional ID in order to identify global variables from this run (only bash variable names, no '-'). Global variables are WAIT_FOR_TASK_COMPLETION_$id and HARD_MAX_EXEC_TIME_REACHED_$id
localid="${2:-(undisclosed)}"# Optional ID in order to identify global variables from this run (only bash variable names, no '-'). Global variables are WAIT_FOR_TASK_COMPLETION_$id and HARD_MAX_EXEC_TIME_REACHED_$id
localreadFromFile="${3:-false}"# Is mainInput / auxInput a semicolon separated list (true) or a filepath (false)
localsoftPerProcessTime="${4:-0}"# Max time (in seconds) a pid or command can run before a warning is logged, unless set to 0
localhardPerProcessTime="${5:-0}"# Max time (in seconds) a pid or command can run before the given command / pid is stopped, unless set to 0
@ -905,7 +905,7 @@ function ExecTasks {
fi
if[$functionMode=="WaitForTaskCompletion"];then
# Force first while loop condition to be true because we don't deal with counters but pids in WaitForTaskCompletion mode
# Force first while loop condition to be true because we do not deal with counters but pids in WaitForTaskCompletion mode
counter=$mainItemCount
fi
@ -931,7 +931,7 @@ function ExecTasks {
if[$log_ttime -ne $exec_time];then# Fix when sleep time lower than 1 second
log_ttime=$exec_time
if[$functionMode=="WaitForTaskCompletion"];then
Logger "Current tasks still running with pids [$(joinString , ${pidsArray[@]})].""NOTICE"
Logger "Current tasks ID=$idstill running with pids [$(joinString , ${pidsArray[@]})].""NOTICE"
elif[$functionMode=="ParallelExec"];then
Logger "There are $((mainItemCount-counter+postponedItemCount)) / $mainItemCount tasks in the queue of which $postponedItemCount are postponed. Currently, ${#pidsArray[@]} tasks running with pids [$(joinString , ${pidsArray[@]})].""NOTICE"
fi
@ -989,7 +989,7 @@ function ExecTasks {
pidState="$(eval$PROCESS_STATE_CMD)"
if["$pidState" !="D"]&&["$pidState" !="Z"];then
# Check if pid hasn't run more than soft/hard perProcessTime
# Check if pid has not run more than soft/hard perProcessTime
Logger "No directories available to watch.""CRITICAL"
fi
}
#### InotifyWaitPoller SUBSET END ####
# If using "include" statements, make sure the script does not get executed unless it's loaded by bootstrap.sh which will replace includes with actual code
_OFUNCTIONS_BOOTSTRAP=true
["$_OFUNCTIONS_BOOTSTRAP" !=true]&&echo"Please use bootstrap.sh to load this dev version of $(basename $0) or build it with merge.sh"&&exit1
@ -2640,7 +2795,7 @@ else
fi
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to it's environment so it knows it has to write into a separate directory
## If the same program gets remotely executed, add _REMOTE_EXECUTION=true to environment so it knows it has to write into a separate directory
## This will thus not affect local $RUN_DIR variables