wipe destination in _CURRENT
This commit is contained in:
@@ -8,4 +8,5 @@ set "rc=%errorlevel%"
|
||||
echo PowerShell exited with RC=%rc%
|
||||
echo @"_CURRENT\_UpdateSequences.log"
|
||||
echo Done.
|
||||
pause >nul
|
||||
exit /b %rc%
|
||||
@@ -174,6 +174,15 @@ try {
|
||||
$srcFull = $parts[1]
|
||||
$seqName = $parts[2]
|
||||
$dstAbs = Join-Path $currentDir $seqName
|
||||
if (Test-Path -LiteralPath $dstAbs) {
|
||||
"[$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')] WIPE: removing existing destination '$dstAbs'" | Add-Content -LiteralPath $logFile
|
||||
try {
|
||||
Remove-Item -LiteralPath $dstAbs -Recurse -Force -ErrorAction Stop
|
||||
}
|
||||
catch {
|
||||
"[$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')] WIPE ERROR: $($_.Exception.Message)" | Add-Content -LiteralPath $logFile
|
||||
}
|
||||
}
|
||||
if (-not (Test-Path -LiteralPath $dstAbs)) { New-Item -ItemType Directory -Path $dstAbs -Force | Out-Null }
|
||||
"[$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')] Mirror: '$srcFull' -> '$dstAbs'" | Add-Content -LiteralPath $logFile
|
||||
$robocopyArgs = @(
|
||||
|
||||
Reference in New Issue
Block a user