music-audit: followup must not treat an unreachable host as a finished run
When the Netbird tunnel dropped, ssh to yveltal timed out and the script wrote 'INCOMPLETE - process is gone' and marked the run done, which would have left the report wrong and the timer silent. Now an ssh failure logs 'unreachable, will retry next tick' and exits without touching the state file.
This commit is contained in:
1 parent
3fd4ae0109
commit
39fcf6bc4f
1 file changed
+7
@@ -36,6 +36,13 @@ if [ "${FORCE:-0}" != "1" ] && ssh -o BatchMode=yes -o ConnectTimeout=10 "$SSH_H
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# If the host cannot be reached at all, do nothing: the job is still running there and
|
||||
# an unreachable host must never be recorded as a finished pass (it was, once).
|
||||
if ! ssh -o BatchMode=yes -o ConnectTimeout=10 "$SSH_HOST" 'true' 2>/dev/null; then
|
||||
echo "$(date -u +%H:%M:%SZ) yveltal unreachable, will retry next tick" >> "$LOG"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Process gone: distinguish "finished" from "died".
|
||||
finished=$(ssh -o BatchMode=yes -o ConnectTimeout=10 "$SSH_HOST" \
|
||||
'sudo -n grep -E "finished: matched=" /var/log/music-identify.log | tail -1' 2>/dev/null)
|
||||
|
||||
Reference in new issue
Block a user