Is it possible to abort process for gnu parallel process if it exceeds an estimated runtime? For example, I have a handler for recon-all processing:
while [ -n "${ids[0]}" ] ; do
printf 'Processing ID: %s\n' "${ids[@]}" >&2
/usr/bin/time -f "$timefmt" \
printf '%s\n' "${ids[@]}" | parallel --jobs 0 recon-all -s {.} -all -
qcache -parallel -openmp 8
n=$(( n + 1 ))
ids=( "${all_ids[@]:n*4:4}" ) # pick out the next eight IDs
done
and some patients in recon-all process inside parallel couldn't be completed for some reasons (could run several days, which abnormal). Could I limit the runtime inside parallel for 9 hours, so the command will run another group in the cycle?