wipe destination in _CURRENT
This commit is contained in:
@@ -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