Robocopy and the MOT switch for scheduled jobs

Posted on 2005-04-20
Medium Priority
Last Modified: 2011-10-03
We are planning on using robocopy to copy the contents of an entire directory from one server to another but it must be run once a day at 10 PM.  I have looked into the MOT switch but I have two questions:

1. How can I make robocopy run at 10 PM exactly?  The MOT switch identifies the minimum time in minutes that must elapse before running again.  In order to accomplish this do I have to start robocopy at 10 PM and then set the /MOT:m value to 1440?  I saw something on using the /RH switch, but how exactly would we implement it for our purpose?

2. What if the server is rebooted?  Does robocopy start up automatically?  I doubt it, so how do I ensure my special robocopy.exe command is started every 24 hours?

Question by:djs120
LVL 85

Accepted Solution

oBdA earned 1000 total points
ID: 13827611
To run it at 10 exactly, and to make sure it continues to run after a reboot, it's best to use the task scheduler.
Either do it with the "GUI" task scheduler, where you can specify an account to run the command (to provide the network credentials), or use "at.exe" from the command line. If in doubt, I prefer the latter one, it's somewhat more reliable.
For this to work with at.exe, you need a small batch script (which should be put into a folder secured with NTFS permissions to allow only administrators access, as you need to specify a password in it):

net use \\OtherServer\IPC$ password /user:SomeDomain\SomeUser
robocopy T:\hisS\erver \\OtherServer\SomeShare ...
net use \\OtherServer\IPC$ /delete

the at command should be something like
at 10:00pm /every:m,t,w,th,f,s,su C:\Secure\folder\robocopy-script.cmd

(Don't rely on me with the time format, I'm using military time ...)

Author Comment

ID: 13827817
Thanks, the task scheduler is where it's at.

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question