How it Works

Both the setup and mirror process are very simple and goes like this:

Create and share a folder on your network where you would like the user files stored. Users will need read and write access to this folder. Place the backup script in the network share. Schedule a task on each user’s computer to run the backup script from the network share. The script mirrors the documents stored on the local machine to the network share.

The script utilizes the Microsoft RoboCopy tool and automatically creates the “/Computer Name/User Name” folder structure inside the network folder so user documents will not overwrite each other.

The Script

Scheduling the Backup Script on User Machines

Once the network share and batch script are in place, setting up a simple Scheduled Task is all you have to do on each client machine. This Scheduled Task which runs the script only requires a few special options which we will point out here.

Because the script’s source and destination folders for the mirror process are driven by the Windows User Account, you will need to make sure the Scheduled Task runs under the respective user’s Windows login.

If you have multiple users who utilize the same machine, you will need to set up a Scheduled Task for each user so the script. In situations like this, you may want to select the option to only have the script run when the user is logged in.

Schedule the task to run whenever appropriate. You might want to consider having the process repeat several times throughout the day so changes are mirrored with the server often.

The program/script is the batch script stored on the network.

Since the backup can only run if a network connection is available, you can configure this option. This is optional because if the connection is not available the task will not run anyway because it cannot find the target program/script. Additionally, if you have the Scheduled Task set to run at a time when the computer may not be in use and/or asleep, select the option to wake the computer in order to run the task.

Configure advanced options as needed. One option of interest is “Run task as soon as possible after a scheduled start is missed” which will ensure backup intervals are not completely skipped in the event the machine is turned off.

The Result

As we mentioned earlier, the first time the mirror process runs the folder structure is created and all documents from the configured source folders are copied to the network. Needless to say, the copy can take a while depending on the amount of data. Subsequent executions of the Schedule Task will complete much quicker as files from the local machine are added, updated and deleted as needed to keep the mirrored structure.

Download BackupFiles Script from SysadminGeek.com

Download Windows Server 2003 Toolkit (which includes RoboCopy.exe) from Microsoft