WinRoboCopy: The Complete Guide to Fast Windows File Syncing

Setting Up Scheduled Backups with WinRoboCopy on Windows

Scheduled backups using WinRoboCopy let you automate reliable file copies on Windows with granular options for file selection, retries, and logging. This guide walks through installing WinRoboCopy (or using native Robocopy if WinRoboCopy is a wrapper), creating a robust copy command, testing it, and scheduling it with Task Scheduler.

What you’ll need

  • A Windows PC (Windows ⁄11 or Server).
  • WinRoboCopy installed, or access to built-in Robocopy (included in Windows).
  • Destination with enough free space (local drive, external disk, or network share).
  • Administrative privileges to create scheduled tasks and access some folders.

1. Create the backup command

Use a single-line command that includes source, destination, options, and logging. Example (replace paths with yours):

Code

“C:\Program Files\WinRoboCopy\winrobocopy.exe” “C:\Users\Alice\Documents” “\BackupServer\Backups\Alice\Documents” /MIR /Z /R:3 /W:5 /MT:8 /LOG:“C:\Logs\WinRoboCopyDocuments.log” /TEE
  • Source and Destination: quoted paths.
  • /MIR: mirror source to destination (adds and removes files to match). Use with caution.
  • /Z: restartable mode for unreliable connections.
  • /R:3 /W:5: retry 3 times, wait 5 seconds between retries.
  • /MT:8: multithreaded copy using 8 threads (improves speed).
  • /LOG: and /TEE: write to log file and show output in console.

Alternative safer option (no deletions): replace /MIR with /E to copy all subfolders without deleting.

2. Test the command manually

  1. Open PowerShell or Command Prompt as your user.
  2. Run the command and confirm files copy as expected and the log shows no critical errors.
  3. If permission errors appear, run elevated (as Administrator) or adjust folder permissions.

3. Create a batch file for scheduling

Save the command into a .bat file for Task Scheduler:

Code

@echo off “C:\Program Files\WinRoboCopy\winrobocopy.exe” “C:\Users\Alice\Documents” “\BackupServer\Backups\Alice\Documents” /MIR /Z /R:3 /W:5 /MT:8 /LOG:“C:\Logs\WinRoboCopy_Documents.log” /TEE exit /b %ERRORLEVEL%

Place the .bat in a stable location, e.g., C:\Scripts\WinRoboCopy_BackupDocuments.bat

4. Schedule the backup with Task Scheduler

  1. Open Task Scheduler (taskschd.msc).
  2. Click Create Task… (not “Create Basic Task” for more options).
  3. On the General tab:
    • Name the task (e.g., WinRoboCopy — Documents Backup).
    • Choose Run whether user is logged on or not if you want it to run in background.
    • Check Run with highest privileges if needed for protected folders.
  4. On the Triggers tab: New… and choose schedule (daily, weekly, or at logon). Set start time.
  5. On the Actions tab: New…
    • Action: Start a program.
    • Program/script: Browse to your .bat file (or to winrobocopy.exe and put arguments in “Add arguments”).
  6. On Conditions and Settings tabs: adjust as needed (e.g., only run if on AC power, stop task if it runs longer than X hours).
  7. Click OK and provide credentials if prompted.

5. Configure notifications and log rotation

  • Use the built-in /LOG switch to keep a log file. Use /UNILOG or /LOG+ to handle Unicode or append logs.
  • Rotate logs by including a date in the filename in your batch file:

Code

set dt=%date:~10,4%-%date:~4,2%-%date:~7,2% “C:\Program Files\WinRoboCopy\winrobocopy.exe” “C:\Users\Alice\Documents” “\BackupServer\Backups\Alice\Documents” /MIR /Z /R:3 /W:5 /MT:8 /LOG:“C:\Logs\WinRoboCopyDocuments%dt%.log” /TEE

(Adjust date parsing for your locale; use PowerShell for more robust timestamping.)

  • For alerts, add an Action that runs a script to email or post a message if the log contains errors, or use Task Scheduler to trigger on task failure.

6. Verify and maintain

  • Check logs regularly for errors.
  • Periodically run a restored-file spot check to ensure backups are usable.
  • Update the task if source/destination paths change.
  • Consider versioned backups or incremental strategies if accidental deletions are a concern (avoid /MIR).

Troubleshooting (quick)

  • Permission denied: run task with account that has access or grant permissions.
  • Network paths fail: use a UNC path and ensure “Run whether user is logged on or not” with stored credentials; map network drives within the script if needed.
  • Large file sets slow: increase /MT or exclude unneeded files with /XF and /XD.

If you want, I can generate a ready-to-use .bat with date-stamped logs and an example Task Scheduler XML you can import.

Comments

Leave a Reply

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