Specifying a Copy Schedule in Robocopy

Written by Barry Dysert (last updated October 30, 2017)

2

You can use the built-in scheduling capability of Robocopy to specify a copy schedule instead of resorting to the Windows Task Scheduler to perform copies. There are actually a few different ways to use a copy schedule. When you specify the /MON:n switch Robocopy stays running and continually monitors the source directory for changes. When it detects that "n" or more changes have occurred to the source directory it implements these changes in the destination. (That is, when files get created in the source, the files are automatically copied to the destination.)

C:\> ROBOCOPY C:\Temp1 C:\Temp3 /MON:1

You exit the running of Robocopy by pressing the CTRL+C combination.

Similar behavior exists by specifying the /MOT:m switch. In this case, Robocopy stays running and performs another copy (if necessary) in "m" minutes' time if things have changed.

C:\> ROBOCOPY C:\Temp1 C:\Temp3 /MOT:1

So, with this command line, Robocopy looks for changes once every minute, and if there are any they are implemented. As before, press CTRL+C to stop Robocopy from running.

A third way of scheduling a copy is to use the /RH:hhmm-hhmm switch. This tells Robocopy that it can only copy files between the hours/minutes of the first "hhmm" and the second "hhmm". There are, of course, three scenarios here. If the timeframe specified with /RH has already passed, Robocopy will remain paused until the time occurs the next day. If the current system time is within the boundaries established with /RH then the copy occurs immediately. Finally, if the timeframe specified with /RH is in the future, Robocopy remains paused until the time occurs, and then the copy is performed. As an example:

C:\> ROBOCOPY C:\Temp1 C:\Temp3 /RH:1300-1400

This tells Robocopy to do its copying between the hours of 1300 and 1400 (1:00 pm and 2:00 pm).

 This tip (13219) applies to Windows 7, 8, and 10.

Author Bio

Barry Dysert

Barry has been a computer professional for over 35 years, working in different positions such as technical team leader, project manager, and software developer. He is currently a software engineer with an emphasis on developing custom applications under Microsoft Windows. When not working with Windows or writing Tips, Barry is an amateur writer. His first non-fiction book is titled "A Chronological Commentary of Revelation." ...

MORE FROM BARRY

Removing a File Type Program Association

Removing a file type program association is a task for third-party utilities. You can, however, change the association ...

Discover More

Using the Hosts File to Block Content

Although there are better methods, you can use the Hosts file to block access to specific websites. This tip tells you how.

Discover More

Adjusting Vison Settings in the Ease of Access Center

If you have vision impairments that affect your ability to use your computer, Windows 10's Ease of Access Center can help ...

Discover More
More WindowsTips

Saving a Windows Search

Windows has a built-in search utility that allows you to search for strings inside of files. You can even save your ...

Discover More

Checking the Archive Attribute with Robocopy

Robocopy can work on files according to each file's attributes. This tip shows you how to use Robocopy to only copy files ...

Discover More

Using Robocopy with File Sizes and Ages

Robocopy is a robust file copy utility built into Windows. The various switches built into the program provide very ...

Discover More
Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 1 + 1?

2022-03-09 09:13:54

Jonathan

In the below, isn't the first scenario and the last scenario, the same? Both scheduled times are in the future.

A third way of scheduling a copy is to use the /RH:hhmm-hhmm switch. This tells Robocopy that it can only copy files between the hours/minutes of the first "hhmm" and the second "hhmm". There are, of course, three scenarios here. If the timeframe specified with /RH has already passed, Robocopy will remain paused until the time occurs the next day. If the current system time is within the boundaries established with /RH then the copy occurs immediately. Finally, if the timeframe specified with /RH is in the future, Robocopy remains paused until the time occurs, and then the copy is performed. As an example:

C:\> ROBOCOPY C:\Temp1 C:\Temp3 /RH:1300-1400


2018-05-18 08:42:23

Christophe

hello,
thanks for your tuto.
Additional info: you should use /PF to limit robocopy to run only within the timings specified in /RH switch.


Newest Tips