Robocopy – Can Robocopy Monitor Files on a Time Increment of Less Than One Minute?

command linerobocopywindows 8

Robocopy has the option to monitor the source directory, and copy over any files that have changes. You can specify how many changes in the directory must occur before copying (/mon n where n is the number of changes) and how long to wait before rescanning (/mot t where t is the time to wait in minutes).

I'd like to monitor a folder nearly continuously, since there's only 1 file I'm scanning for, and I want changes to be basically instant. I can't seem to make robocopy monitor for a timespan less than one minute though. I've tried /mot 0.5 and it fails. I also tried /mot 0 and robocopy just exits after scanning once, without monitoring continuously.

How can I make robocopy scan a folder near-continuously, with time increments of less than 1 minute? Alternatively, is there any other command line tool that can constantly monitor a file source and copy changes in real time?

Best Answer

Robocopy

/mot:<M>
Monitors source, and runs again in M minutes if changes are detected.

As it accepts only minutes as argument, I guess you can't force it to run more often. You could however, run it using a batch file and let the timing & looping occur in the batch-file or in scheduled tasks rather than within robocopy.

Related Question