I am trying to use robocopy to move files from a source directory to a destination directory. The problem is that an inetpub mail process monitors the destination directory, and quickly locks and deletes files placed there. Here's what seems to be happening:
1) I call
Robocopy C:\test c:\test1 /COPY:D /MOV /IPG:50 /R:1000000 /W:30 /Z /Log:C:\robolog\RoboLog.txt
Robocopy seems to ignore the /D switch, and includes this in the log:
Source : C:\test\
Dest : c:\test1\
Files : *.*
Options : *.* /COPY:DT /MOV /Z /IPG:50 /R:1000000 /W:30
2) I suspect that Robocopy copies the data to the destination, then writes the timestamp, then deletes the file from the source directory. Because inetpub deletes some files before Robocopy can write the timestamp, I see errors in the log like this:
2011/08/18 10:17:06 ERROR 2 (0x00000002) Time-Stamping Destination File C:\test\Foo.txt
The affected files are copied, but they also remain in the source directory
3) Robocopy fails with error 9 because of the files that were copied but not deleted.
Is there a way to fix this? If my assessment is correct, then if I could get Robocopy to copy just the data and leave timestamps as a default value, that would work.