Whilst Apple operating systems, and Linux, both have handy features (such as ‘rsync’) to help automatically backup your computer, it is often assumed that Windows has so no such feature.
Fortunately this is not true. Windows Vista and 7 both have a tool installed by default known as ‘robocopy’, which works in a similar way to rsync. Essentially it is a way of copying source data (such as from your primary hard drive) to another destination (such as a backup hard drive). It does this incrementally, meaning only new files will be copied over (so it’s a fairly quick backup method).
Critical Process Died Windows 10
This tool is not available by default on older Windows OSes (such as Windows XP), although it is available to download for free. You might be asking yourself ‘why would I want to setup a mirroring/automatic backup system’? If so, this is a valid quesiton.
The primary reason is because backups are obviously necessary since if you have a hard drive crash (on your main hard drive), having backups will allow you to get back up and running quickly, without any major data loss.
The other reason why using robocopy is a good idea is because it’s very easy to forget about making backups, so automating this process has clear advantages. Okay, onto the step-by-step process:
Step 1: Get robocopy, if applicable
If you don’t run Windows Vista or Windows 7, you won’t have robocopy installed by default. Fortunately, you can download it for free. Once downloaded, run and install the file.
Step 2: Setup the batch (.bat) file
To automate the hard drive backup process, using a batch file is a good idea. To do this, firstly open Notepad. Enter the following command, changing “C:” and “B:” as necessary (change “C:” – the source – to your primary hard drive location, if it’s not “C:”, and change “B:” – the destination – to your backup hard drive location):
robocopy C:\ B:\ /MIR /R:1 /W:1 /DCOPY:T
/MIR is equivalent of using both the /E (copy everything including subdirectories) and /PURGE (delete files in destination which no longer exist in the source) flags. /R:1 means that robocopy should retry failed file copies (such as locked Window OS files) once, and /W:1 means to wait 1 second before retrying the file copy.
/DCOPY:T copies over the directory timestamps (so that the created and last modified times listed in the directories are accurate).
There are other robocopy options, which you can see by typing in “robocopy /?” into a command prompt. NB: These are the settings we recommend if you want to setup a mirrored hard drive system (else, if you want to use your backup hard-drive for other uses too, we suggest you replace ‘/MIR’ with just ‘/E’).
Step 3: Save the file
In notepad, set ‘Save As Type’ to all files and then enter the filename as [Name].bat – changing [Name] to whatever you like. Save this file somewhere where you aren’t likely to delete it.
Now create a shortcut of this file by right clicking on it, going to ‘Send to’ and selecting ‘Desktop (create shortcut). Now drag this file into the ‘Startup’ folder of your computer’s menu:
Drag the file to your startup folder
This will automatically start the batch file every time your computer backs up, meaning your primary hard drive will be auto-backed up whenever you start up your computer. Naturally you can click on this .bat file whenever you like to backup; you don’t only have to run it when you boot up your computer.
In-fact robocopy will take a while to run the first time (as it’ll have to copy over every single file!), so we do recommend that you manually run it the first time (by simply double clicking on the .bat file you have created).
Since robocopy is incremental, it will be much quicker in the future.
When your computer starts up, it will typically be fairly slow due to loading the programs in your start-up list along with running a range of other OS-related processes which run on start-up. Hence you might want to delay the running of robocopy. To do this, an easy way is to add the following to the top of your .bat file (simply right click it and click ‘Edit’):
ping 22.214.171.124 -n 1 -w 100000 > nul
This command pings a random IP address once (denoted by -n 1), and waits (-w) 100,000 milliseconds – i.e. 100 seconds – before continuing. This essentially means that the robocopy command will run 100 seconds after your computer is booted up (after which time, your computer should no longer be slow due to just being started).
Also, if you want to output everything that robocopy does (instead of showing it in the console window), you can setup a log file for the output to go to using the /LOG: flag (so, /LOG:log.txt will write to the log file ‘log.txt’)
Finally, you might want to test changing “/R:1” to “/R:0” – this means that if a file cannot be copied over (such as if it’s an in-use system file), robocopy won’t attempt to copy it over again. Making this change will speed up the file backup process a fair bit, especially considering that 99% of files which couldn’t be copied over still will be in-use when robocopy tries it again.
Finally, if you are wanting to keep the backup data within a folder instead of the root of the backup hard drive, you may notice that robocopy – annoyingly! – sets the backup folder to hidden and a system folder; meaning that it does not appear by default. The way around this is to use the attrib command after the robocopy command, and strip out the hidden and system attributes. So your final .bat file might look something like this:
ping 126.96.36.199 -n 1 -w 100000 > nul
robocopy C:\ B:\Mirror /MIR /R:0 /DCOPY:T /XN /LOG:log.txt
ATTRIB -R -A -S -H /S /D B:\Mirror