Scheduling Robocopy

You can use the Windows NT AT command, or the Resource Kit SOON command, with the

Windows NT Schedule Service to create Robocopy jobs that run regularly in the background,

to automatically maintain local mirrors of remote directory trees.

By default the Schedule Service logs on as the System Account for the local system, which

has no network access. Scheduled jobs run in the same context as the Schedule Service. So,

in order to successfully schedule a Robocopy job, some extra configuration is required. There

are basically two options :

Option 1) Leave the Schedule Service running in the context of the local System Account,

and schedule batch files of the following form :

NET USE \\remoteserver\IPC$ /USER:userid password ROBOCOPY \\remoteserver\sourcepath \\localserver\destpath ... NET USE \\remoteserver\IPC$ /DEL

Within each such job, credentials with remote servers are established by connecting to the

IPC$ (Inter Process Communication) share on remote machines using an appropriate user

account, rather than as the local System account. The disadvantage of this approach is that

user passwords are stored in the batch files, but they can be protected by storing the batch

files on an NTFS partition, and applying appropriate NTFS file security to the batch files.

Option 2) In Control Panel/Services/Schedule Service/Startup configure the Schedule

Service to use a "real" user account that you have created in User Manager, by specifying an

appropriate User Id and Password in the "Log On As" section. Then you should Stop and

Start the Schedule Service to get it running in the new user context. Once the nominated

user has been granted appropriate access to source and destination servers, you can now

schedule Robocopy jobs to copy files between them.

Finally, as drive mappings can be changed by users, it is generally best to use UNC names

for source and destination directories in scheduled Robocopy jobs, as these explicity specify

file locations, and are more reliable. I.e. rather than scheduling a command of the form :

ROBOCOPY X:\source Y:\dest ...

for increased reliability, you should use commands of the form :

ROBOCOPY \\server1\share1\source \\server2\share2\dest ...

AT and the Schedule Service are documented in the Windows NT Commands on-line help.

SOON is documented in the Windows NT Resource Kit on-line documentation.