diff --git a/codearchiver-bot b/codearchiver-bot index cbe08d2..bf04360 100755 --- a/codearchiver-bot +++ b/codearchiver-bot @@ -135,7 +135,7 @@ function respond { # Handle marker for end of list job: tell the user it's done and move on. if [[ "${url}" == 'end' ]]; then # No status code reflection here because the start of the list job might not even have been in this batch. - respond "${nick}" "Job ${jobid} finished." + respond "${nick}" "Job ${singlejobid} finished." statuscodes+=(-1) continue fi @@ -143,12 +143,12 @@ function respond { # Find nonexistent filename for log file (*not* concurrency-safe!) logbasename="$(date +%Y%m%dT%H%M%SZ)_${singlejobid}" if [[ -e "${logbasename}_codearchiver.log" ]]; then - for ((i=0; ; ++i)); do - if [[ ! -e "${logbasename}_coll${i}_codearchiver.log" ]]; then + for ((j=0; ; ++j)); do + if [[ ! -e "${logbasename}_coll${j}_codearchiver.log" ]]; then break fi done - logbasename="${logbasename}_coll${i}" + logbasename="${logbasename}_coll${j}" fi logname="${logbasename}_codearchiver.log" artefactsname="${logbasename}_codearchiver_artefacts.txt" @@ -157,7 +157,7 @@ function respond { log "Running ${url} (${singlejobid}), logging into ${logname}" codearchiver --verbose --write-artefacts-fd-3 "${url}" \ 2> >(tee "${logname}" | grep -Fv -e ' INFO ' | log_loop "From codearchiver ${singlejobid}: ") \ - 3> >(tee "${artefactsname}" | log_loop "New artefacts from codearchiver ${singlejob}: ") + 3> >(tee "${artefactsname}" | log_loop "New artefacts from codearchiver ${singlejobid}: ") status="$?" log "codearchiver ${url} finished with status code ${status}" statuscodes+=("${status}")