Last active
April 25, 2016 17:46
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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