The little things give you away... A collection of various small helper stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

4 lines
700 B

  1. #!/bin/bash
  2. # For each ArchiveBot job running on the machine, list requests that are stuck, i.e. older than 6 hours
  3. ps -C wpull --format 'pid,cmd' --no-headers | sed 's,^\s*,,; s,\s*/usr/bin/python3.*/data/[^/]\+/\([0-9a-z]\+\)/wpull\.log.*$, \1,' | while read -r pid jobid; do echo "$jobid (PID $pid)"; fs=$(find /proc/${pid}/fd -lname '*/tmp-wpull-warcsesreq-*' -printf '%l\n' 2> >(grep -v ': No such file or directory$' >&2)); fs=$(find ${fs} -mmin +360); if [[ "${fs}" ]]; then for f 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