Files
claudetools/clients/dataforth/scripts/check-latest-errors.ps1
Mike Swanson 5cbd49ce24 Reorganize repo: compartmentalize scripts by client/project
Move 150+ scripts from root and scripts/ into client/project directories:
- clients/dataforth/scripts/ (110 files: AD2, sync, SSH, DB, DOS scripts)
- clients/bg-builders/scripts/ (14 files: Lesley mgmt, Exchange, termination)
- clients/internal-infrastructure/scripts/ (10 files: GDAP, Gitea, backups)
- projects/msp-tools/scripts/ (9 files: CIPP, MSP onboarding, Datto)
- projects/gururmm-agent/scripts/ (3 files: API test, JWT, record counts)
- clients/glaztech/scripts/ (1 file: CentraStage removal)

Also reorganized:
- VPN scripts → infrastructure/vpn-configs/
- Retrieved API/JS files → api/
- Forum posts → projects/community-forum/forum-posts/
- SSH docs → clients/internal-infrastructure/docs/
- NWTOC/CTONW docs → projects/wrightstown-smarthome/docs/
- ACG website files → projects/internal/acg-website-2025/
- Dataforth docs → clients/dataforth/docs/
- schema-retrieved.sql → docs/database/

Deleted 24 tmp_*.ps1 one-off debug scripts (preserved in git history).
Root reduced from 220+ files to 62 items (docs + directories only).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 17:15:07 -07:00

56 lines
2.3 KiB
PowerShell

# Check the absolute latest log entries for SCP PUSH ERROR messages
$password = ConvertTo-SecureString "Paper123!@#" -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential("INTRANET\sysadmin", $password)
Invoke-Command -ComputerName 192.168.0.6 -Credential $cred -ScriptBlock {
$logFile = "C:\Shares\test\scripts\sync-from-nas.log"
Write-Host "=== Latest Log Analysis ===" -ForegroundColor Cyan
Write-Host ""
Write-Host "[1] Log file size and last modified" -ForegroundColor Yellow
$logInfo = Get-Item $logFile
Write-Host "Size: $([math]::Round($logInfo.Length / 1MB, 2)) MB" -ForegroundColor Gray
Write-Host "Last Modified: $($logInfo.LastWriteTime)" -ForegroundColor Gray
Write-Host ""
Write-Host "[2] Last 50 lines of log" -ForegroundColor Yellow
Write-Host "=" * 80 -ForegroundColor Gray
Get-Content $logFile -Tail 50 | ForEach-Object {
if ($_ -match "SCP PUSH ERROR|SCP ERROR") {
Write-Host $_ -ForegroundColor Red
} elseif ($_ -match "ERROR") {
Write-Host $_ -ForegroundColor Yellow
} elseif ($_ -match "Starting sync|Sync complete") {
Write-Host $_ -ForegroundColor Cyan
} else {
Write-Host $_ -ForegroundColor Gray
}
}
Write-Host ""
Write-Host "[3] Searching entire log for 'SCP PUSH ERROR'" -ForegroundColor Yellow
Write-Host "=" * 80 -ForegroundColor Gray
$scpErrors = Get-Content $logFile | Select-String -Pattern "SCP PUSH ERROR"
if ($scpErrors) {
Write-Host "[SUCCESS] Found $($scpErrors.Count) detailed SCP error(s)!" -ForegroundColor Green
Write-Host ""
Write-Host "First 10 occurrences:" -ForegroundColor Cyan
$scpErrors | Select-Object -First 10 | ForEach-Object {
Write-Host $_ -ForegroundColor Red
}
} else {
Write-Host "[INFO] No 'SCP PUSH ERROR' messages found in entire log file" -ForegroundColor Yellow
Write-Host "This means either:" -ForegroundColor Gray
Write-Host " 1. No sync has run since the fix was applied" -ForegroundColor Gray
Write-Host " 2. No errors occurred (all files pushed successfully)" -ForegroundColor Gray
Write-Host " 3. The fix hasn't taken effect yet" -ForegroundColor Gray
}
}
Write-Host ""
Write-Host "=== Analysis Complete ===" -ForegroundColor Cyan