Robocopy Attribute Error Not Picking up All files?

0

Apologies as I'm still fairly new to PowerShell - I've recently implemented RoboCopy to transfer a large amount of .eml files from one server to another. This generally work's fine however it's skipping 8-10 files each time and throwing out the error below.

2019/04/02 15:37:05 ERROR 2 (0x00000002) Changing File Attributes D:\SMC_Drop\test-test-test-test.eml The system cannot find the file specified.

The files are there however so I'm not too sure on why they are being missed, any ideas?

robocopy $SMCDir $SMCPush $Files /NP /COPY:DT
$RoboError = $LASTEXITCODE
if ($RoboError -le 8 )
{
   Write-Host " Robocopy Succeeded - Exit Code $RoboError"
   $RoboError = 0
}
else
{
   Write-Host " Robocopy failed with errorcode $RoboError"
}

Write-Host " 
=====================================================================================
"
Write-Host " RoboCopy Completed - $Now"
Write-Host " 
=====================================================================================
"

[Environment]::Exit($RoboError)

Output

            Total    Copied   Skipped  Mismatch    FAILED    Extras
 Dirs :         1         0         0         0         0         0
Files :      5002      4992         0         0        10         0
Bytes :   2.805 g   2.789 g         0         0   16.10 m         0
Times :   0:38:33   0:38:32                       0:00:00   0:00:01

Speed :             1295461 Bytes/sec.
Speed :              74.126 MegaBytes/min.
Ended : Tuesday, April 2, 2019 3:56:21 PM

Robocopy failed with errorcode 9
powershell
robocopy
asked on Stack Overflow Apr 2, 2019 by OldBlue • edited Apr 2, 2019 by Abra

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0