Monday 18 June 2018

command line - Can Robocopy monitor files on a time increment of less than one minute?


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?



Answer



Robocopy


/mot:
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.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...