Robocopy - Bugs and suggestions

Copper Contributor

Hello,

I don't really know where to reach out, but I really do love Robocopy and hope that someone inside MS finds the tool valuable enough to continue it's development.

I've come across a few issues as of late:

  • If setting it up to monitor a source using /MOT:n, to make it check for changes every n minutes, it fails to detect changes made if there is a copy operation in progress. Also reported here: windows - Robocopy not seeing new files if in the middle of copying a file - Super User
  • Using the /NP switch breaks the functionality of the /IPG switch and transfers run at maximum speed
  • It would be nice if the logging functionality could release the file handle between writes so that log rollover could be handled externally, for situations when robocopy is used for always-on monitoring applications

Best regards

Alexander

1 Reply

As a workaround for the first problem, this PowerShell script provides a simple solution:

 

 

Start-Job -ScriptBlock {
    robocopy <sourcedir> <destdir> /MOV /MON:1
}

while (1) {
    try {Get-ChildItem <sourcedir> | Foreach-Object {$_.LastWriteTime = Get-Date}}
    catch{}
    Start-Sleep -Seconds 10
}