From ffdf8d053c53262a9ed04e564acb33cb18efb73d Mon Sep 17 00:00:00 2001 From: Roman Buryan Date: Wed, 18 Nov 2026 20:40:18 +0300 Subject: [PATCH] [PRISM] Sync validates each copy/ingest; no false shutdown --- ops/combine/research-pack/sync-to-host.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ops/combine/research-pack/sync-to-host.ps1 b/ops/combine/research-pack/sync-to-host.ps1 index 1487045..3fcc543 100644 --- a/ops/combine/research-pack/sync-to-host.ps1 +++ b/ops/combine/research-pack/sync-to-host.ps1 @@ -12,13 +12,19 @@ Log "host reachable, copying" $remote = "/tmp/prism-import" try { ssh -o BatchMode=yes -o StrictHostKeyChecking=no root@$hostIp "mkdir -p $remote" | Out-Null + if ($LASTEXITCODE -ne 0) { throw "remote mkdir failed" } scp -o BatchMode=yes -o StrictHostKeyChecking=no -r (Join-Path $base "pc-results-merged-clean") "root@${hostIp}:$remote/" | Out-Null + if ($LASTEXITCODE -ne 0) { throw "copy clean failed" } if (Test-Path (Join-Path $base "pc-results-night")) { scp -o BatchMode=yes -o StrictHostKeyChecking=no -r (Join-Path $base "pc-results-night") "root@${hostIp}:$remote/" | Out-Null + if ($LASTEXITCODE -ne 0) { throw "copy night failed" } } scp -o BatchMode=yes -o StrictHostKeyChecking=no (Join-Path $base "yealink-current-staging.yaml") "root@${hostIp}:$remote/" | Out-Null + if ($LASTEXITCODE -ne 0) { throw "copy yealink yaml failed" } scp -o BatchMode=yes -o StrictHostKeyChecking=no (Join-Path $base "other-vendors-staging.yaml") "root@${hostIp}:$remote/" | Out-Null + if ($LASTEXITCODE -ne 0) { throw "copy other yaml failed" } ssh -o BatchMode=yes -o StrictHostKeyChecking=no root@$hostIp "cd /root/buryan-infra; mkdir -p ops/combine/staging/ingest-pc-clean; cp $remote/yealink-current-staging.yaml $remote/other-vendors-staging.yaml ops/combine/staging/ingest-pc-clean/; if [ -d $remote/pc-results-night ]; then rm -rf ops/combine/staging/raw-night; cp -r $remote/pc-results-night ops/combine/staging/raw-night; fi; /opt/work-hub/venv/bin/python ops/combine/research-pack/ingest_extracted.py --in $remote/pc-results-merged-clean --out ops/combine/staging/ingest-pc-clean >> /tmp/prism-sync.log 2>&1; echo done" | Out-Null + if ($LASTEXITCODE -ne 0) { throw "remote ingest failed" } Log "ingested" exit 0 } catch {