How to schedule automatic Folder Backups in Windows with Robocopy and Task Scheduler

Configurare noua (How To)

Situatie

You can back up important folders automatically using only tools built into Windows, with no third-party software.

Requirements: Windows 10/11, a second drive or network share to store the backup.

Solutie

  1. Create the destination folder, for example D:\Backup\Documents.
  2. Open Command Prompt and test the backup manually first:
robocopy "C:\Users\%USERNAME%\Documents" "D:\Backup\Documents" /MIR /R:2 /W:5 /LOG+:"D:\Backup\backup.log"
  1. Check backup.log. A robocopy exit code between 0 and 7 means success; 8 or higher means at least one error.
  2. Press the Windows key, type Task Scheduler and open it.
  3. In the right panel, click Create Basic Task, name it Daily Documents Backup and click Next.
  4. Choose Daily, set a time when the PC is on (for example 20:00) and click Next.
  5. Select Start a program and click Next.
  6. In Program/script enter robocopy. In Add arguments paste:
"C:\Users\YourUser\Documents" "D:\Backup\Documents" /MIR /R:2 /W:5 /LOG+:"D:\Backup\backup.log"

(replace YourUser with your actual username; environment variables are not always expanded here)

  1. Click Finish, right-click the new task and select Run to test it.

Warning: /MIR mirrors the source exactly, so files deleted from the source are also deleted from the backup. If you want to keep deleted files, use /E instead of /MIR.

Tip solutie

Permanent

Voteaza

(0 din 0 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?