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>
61 lines
2.3 KiB
PowerShell
61 lines
2.3 KiB
PowerShell
# Check for detailed SCP error messages in the log
|
|
$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 "=== Checking for SCP Error Details ===" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
Write-Host "[1] Looking for 'SCP ERROR' messages in recent log" -ForegroundColor Yellow
|
|
$scpErrors = Get-Content $logFile -Tail 200 | Select-String -Pattern "SCP ERROR"
|
|
|
|
if ($scpErrors) {
|
|
Write-Host "[FOUND] $($scpErrors.Count) detailed SCP error(s):" -ForegroundColor Green
|
|
Write-Host "=" * 80 -ForegroundColor Gray
|
|
$scpErrors | ForEach-Object {
|
|
Write-Host $_ -ForegroundColor Red
|
|
}
|
|
} else {
|
|
Write-Host "[NOT FOUND] No 'SCP ERROR' messages in recent log" -ForegroundColor Yellow
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "[2] Checking for generic ERROR messages" -ForegroundColor Yellow
|
|
$genericErrors = Get-Content $logFile -Tail 100 | Select-String -Pattern "^\s*\d{4}-\d{2}-\d{2}.*ERROR: Failed to" | Select-Object -First 5
|
|
|
|
if ($genericErrors) {
|
|
Write-Host "[FOUND] Generic error messages (without details):" -ForegroundColor Yellow
|
|
Write-Host "=" * 80 -ForegroundColor Gray
|
|
$genericErrors | ForEach-Object {
|
|
Write-Host $_ -ForegroundColor Red
|
|
}
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "[3] Checking Copy-ToNAS function in script" -ForegroundColor Yellow
|
|
$scriptContent = Get-Content "C:\Shares\test\scripts\Sync-FromNAS.ps1" -Raw
|
|
|
|
if ($scriptContent -match 'function Copy-ToNAS') {
|
|
Write-Host "[INFO] Looking at Copy-ToNAS function..." -ForegroundColor Cyan
|
|
|
|
$lines = Get-Content "C:\Shares\test\scripts\Sync-FromNAS.ps1"
|
|
$inFunction = $false
|
|
$lineNum = 0
|
|
|
|
foreach ($line in $lines) {
|
|
$lineNum++
|
|
if ($line -match 'function Copy-ToNAS') {
|
|
$inFunction = $true
|
|
}
|
|
if ($inFunction) {
|
|
Write-Host "Line $lineNum : $line" -ForegroundColor Gray
|
|
if ($line -match '^\}' -and $inFunction) {
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|