diff --git a/.claude/scripts/guruscan-agent-test.sh b/.claude/scripts/guruscan-agent-test.sh index 728aabfe..0a877a0e 100644 --- a/.claude/scripts/guruscan-agent-test.sh +++ b/.claude/scripts/guruscan-agent-test.sh @@ -186,6 +186,83 @@ PS echo "[OK] uploaded $(basename "$remote") ($nch chunk(s)) -> $(echo "$r"|jq -r '.stdout'|tr -d '\r')" } +# --------------------------------------------------------------------------- +# DETACHED, NO-CAP execution. A scanner must never be killed by an RMM command +# timeout - large drives can scan for hours. So we launch GuruScan as a +# scheduled task with ExecutionTimeLimit=0 (unlimited); the launch command +# returns immediately, the scan runs to completion on its own, and we poll a +# disk done-marker with NO overall cap. +# --------------------------------------------------------------------------- +# gs_launch_detached "" +gs_launch_detached() { + local gsargs="$1" tag="$2" + local wl="$WORK_DIR/wrapper_$tag.ps1" + cat > "$wl" < \$log; \$rc=\$LASTEXITCODE } +catch { \$rc=-1; \$_ | Out-String | Add-Content \$log } +"DONE rc=\$rc at \$(Get-Date -Format o)" | Set-Content \$marker +PS + upload_file "$wl" "C:\\GuruScan\\_detached_${tag}.ps1" || return 1 + local sf="$WORK_DIR/launch_$tag.ps1" + cat > "$sf" <