Back Up Your Data with Robocopy: Commands and Examples

0
Back Up Your Data with Robocopy Commands and Examples

Robocopy, otherwise known as Robust File Copy, is a command-line utility in Windows 10 that allows you to copy files and folders from one place to another while following certain rules you define. In this guide, we’ll look at how to use Robocopy to back up all your data automatically while ensuring nothing gets overwritten or lost in the process. We’ll also look at some examples of what you can do with Robocopy.

Why Use Robocopy?

Robocopy is a powerful backup tool that comes standard with Windows 10. It can be used to copy files, folders, and even entire drives from one location to another. Plus, it’s fast and can be automated with scheduled tasks. Here’s how to use Robocopy to back up your data.

  •   Open an elevated command prompt window.
  •   Type the following command: robocopy C:\UserData D:\UserData /MIR /R:5 /W:5 /XJ
  •  Press Enter on your keyboard.
  •   Wait for the process to complete and then press any key on your keyboard when prompted for yes or no about whether you want to continue copying at this point in time.
  •   If you selected yes, type the following command: robocop C:\Windows\System32 D:\Windows\System32 /MIR /R:2 /W:2
  •   Repeat steps 3-6 until all desired directories have been copied over.
  •   When finished, close the elevated command prompt window.
  •   Create a new task to run robocop every day automatically using Task Scheduler by opening Task Scheduler (you may need to search for it using Cortana).
  •  Select Create Basic Task and select when you would like the task to run as well as what triggers it should start on.

Step 1 – Install Robocopy

Robocopy is a free data backup tool from Microsoft that is included in Windows 10. To use Robocopy, you’ll need to open the Command Prompt. You can do this by searching for Command Prompt in the Start menu. Once you’ve opened the Command Prompt, you’ll need to navigate to the folder where Robocopy is located. The easiest way to do this is to type cd \windows\system32 into the Command Prompt and press Enter. Next, you’ll want to enter robocopy /? and press Enter again.

Step 2 – Backup Folders

Now that you have robocopy installed, you’re ready to start backing up your data. To do this, open the Command Prompt and use the following syntax for each folder you want to back up:

Robocopy C:\Users\YourName E:\backup\YourName /copyall /e /xo

Replacing C:\Users\YourName with the path of your Windows user directory and E:\backup\YourName with the path of where you want it backed up on your external hard drive. If you have more than one file in a folder, robocopy will only copy over files that are different in order to save space. If you want to copy over all files in a specific folder regardless of whether they’ve changed or not, just add /mir after the destination.

Step 3 – Add new folders

If you want to add new folders to your backup, you can do so by adding the /e switch to your robocopy command. This will tell robocopy to copy all subdirectories, even if they’re empty. For example, let’s say you want to add the Documents and Pictures folders to your backup. Your command would look like this robocopy C:\Users\Administrator E:\Users\ Documents /e

robocopy C:\Users\Administrator E:\Users\ Pictures /e

If you have a lot of data in your home folder that is not used very often, it may be worth running an incremental backup instead of doing a full one every time. You can do this by changing the default behavior of robocopy using the -i switch.

Step 4 – Confirm the Copy was Successful

Now that you’ve run the robocopy command, it’s time to check that the copy was successful. There are a few ways to do this. You can check the size of the destination folder to make sure it’s the same as the source folder. You can also open up a few files in the destination folder to make sure they match the originals.

Leave a Reply

Your email address will not be published. Required fields are marked *