Skip to content

Instantly share code, notes, and snippets.

@VertigoRay
Last active April 25, 2016 17:46
Show Gist options
  • Save VertigoRay/1201748923f411e4eff7fe5ee90f445d to your computer and use it in GitHub Desktop.
Save VertigoRay/1201748923f411e4eff7fe5ee90f445d to your computer and use it in GitHub Desktop.
Re: Cloudstation 3005 error: "... cannot be synced due.." https://forum.synology.com/enu/viewtopic.php?f=237&t=80463&p=431612#p431612
[System.Collections.ArrayList] $already_done = @()
Get-Content .\AppData\Local\CloudStation\log\daemon.log -Wait | ?{ $_ -match '\[ERROR\]' } | %{
$_ -match '(\\Users\\[^\\]+\\CloudStation\\[^\]]+)' | Out-Null
if ($Matches[1] -and ($already_done -inotcontains $Matches[1])) {
Write-Host ($Matches[1] | Out-String)
Rename-Item (Resolve-Path $Matches[1]) "_$(Split-Path $Matches[1] -Leaf)"
while (-not (Test-Path $Matches[1])) {
Start-Sleep -Seconds 1
}
Remove-Item "$(Split-Path $Matches[1] -Parent)\_$(Split-Path $Matches[1] -Leaf)" -Force
$already_done.Add($Matches[1]) | Out-Null
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment