File size: 419 Bytes
3b8b7ae
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env bash
# Poll Jupiter until /tmp/task_variance.out is non-empty, then copy it next to this script.
OUT=$(dirname "$0")/task_variance_raw.json
for i in $(seq 1 120); do
  if ssh Jupiter 'test -s /tmp/task_variance.out' 2>/dev/null; then
    ssh Jupiter 'cat /tmp/task_variance.out' > "$OUT" && echo "$(date -u +%FT%TZ) fetched $(wc -c < "$OUT") bytes" && exit 0
  fi
  sleep 120
done
echo "timeout"; exit 2