From 4a83a54616faf45bcb3b4294bc01e8b8af85ac35 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Wed, 20 Mar 2019 23:31:06 +0000 Subject: [PATCH] Print host for each stuck request --- archivebot-list-stuck-requests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archivebot-list-stuck-requests b/archivebot-list-stuck-requests index faf5fb4..a7e0b12 100755 --- a/archivebot-list-stuck-requests +++ b/archivebot-list-stuck-requests @@ -1,3 +1,3 @@ #!/bin/bash # For each ArchiveBot job running on the machine, list requests that are stuck, i.e. older than 6 hours -ps -C wpull --format 'cmd' --no-headers | sed 's,^\s*,,; s,/usr/bin/python3.*/data/[^/]\+/\([0-9a-z]\+\)/wpull\.log.*$,\1,' | while read -r jobid; do pid=$(pgrep -f $jobid); echo "$jobid (PID $pid)"; fs=$(find $(lsof -p $pid -F n | grep '^n.*tmp-' | sed 's,^n,,') -mmin +360 2> >(grep -v ': No such file or directory$' >&2)); if [[ "${fs}" ]]; then ls -al ${fs}; else echo 'None'; fi; echo; done +ps -C wpull --format 'cmd' --no-headers | sed 's,^\s*,,; s,/usr/bin/python3.*/data/[^/]\+/\([0-9a-z]\+\)/wpull\.log.*$,\1,' | while read -r jobid; do pid=$(pgrep -f $jobid); echo "$jobid (PID $pid)"; fs=$(find $(lsof -p $pid -F n | grep '^n.*tmp-wpull-warcsesreq-' | sed 's,^n,,') -mmin +360 2> >(grep -v ': No such file or directory$' >&2)); if [[ "${fs}" ]]; then forf in ${fs}; do mtime=$(date --date="@$(stat -c '%Y' ${f})" '+%Y-%m-%d %H:%M:%S %Z'); grep ^Host ${f} | while read -r outline; do echo "${mtime} ${f} ${outline}"; done; done | sort; else echo 'None'; fi; echo; done