LiveFor sysadmins

Robocopy & Rsync Command Builder

Pick options for mirroring, retries, multithreading, logging and exclusions visually and get a correct Robocopy or rsync command, with an explanation of each flag.

Runs in your browser. Your data never leaves this device.
~/apps/robocopy-rsync-builderruns in your browser · nothing uploaded
Local path or \\server\share
 
What to do
/MT: 8–32 suits most copies
/R
/W
Resilience
/Z resumes after drops · /B uses backup rights
Default *.* (everything)
Comma-separated: /XD
Comma-separated: /XF
/LOG: adds /NP to keep logs clean
/MIR deletes anything in the destination that isn’t in the source. Run it with “Dry run” first, and double-check the destination path.
Command (cmd or PowerShell)
robocopy D:\Shares\Finance \\nas01\Backups\Finance /MIR /COPYALL /DCOPY:DAT /MT:16 /R:3 /W:10 /XJ /XD $RECYCLE.BIN "System Volume Information" /XF *.tmp ~$* /LOG+:C:\Logs\finance-backup.log /NP /TEE /L
What each option does
  • /MIRMirror: copy subfolders (including empty ones) AND delete files in the destination that no longer exist in the source
  • /COPYALLCopy data, attributes, timestamps, NTFS permissions, owner and auditing info
  • /DCOPY:DATKeep folder attributes and timestamps too
  • /MT:16Copy with 16 threads at once (1–128); much faster for many small files
  • /R:3Retry a failed file 3 times (the default is 1,000,000)
  • /W:10Wait 10 seconds between retries (the default is 30)
  • /XJSkip junction points, which avoids endless loops through folders like “Application Data”
  • /XD $RECYCLE.BIN "System Volume Information"Exclude these folders (names, wildcards or full paths)
  • /XF *.tmp ~$*Exclude these files (names or wildcards)
  • /LOG+:C:\Logs\finance-backup.logAppend the output to this log file
  • /NPDon’t print per-file percentages, which bloat log files
  • /TEEAlso show the output in the console while logging
  • /LList only: show what would happen without copying, moving or deleting anything

Robocopy exit codes 0–7 mean success (1 = files copied, 2 = extra files found, 3 = both). 8 or above means some files failed. Check this in scripts instead of treating any non-zero code as an error.

What it does

  • Robocopy and rsyncBuild commands for Windows file servers or Linux and macOS, from the same screen.
  • Every flag explainedA plain-English line for each option, so you know exactly what the command will do.
  • Safety firstWarnings for destructive options like /MIR and --delete, and a one-click dry run.
  • ShareableCopy a link to the exact command for a change request or a colleague.

How to use it

  1. Choose Robocopy or rsync
  2. Enter the source and destination

    Network shares (\\server\share) and remote paths (user@host:/path) both work.

  3. Pick the options you need

    Start with a dry run, especially when mirroring.

  4. Copy the command and run it

    Check the log, then run again without the dry-run option.

Questions people ask

What is the difference between /MIR and /E in Robocopy?

/E copies all subfolders, including empty ones, and never deletes anything. /MIR does the same but also deletes files in the destination that no longer exist in the source, making an exact mirror.

How many threads should I use with /MT?

/MT on its own uses 8 threads; you can set 1 to 128. 8–32 suits most copies. Many small files benefit most; a few huge files gain little.

Why does Robocopy return exit code 1?

Robocopy’s exit codes are a bitmap: 0 means nothing needed copying, 1 means files were copied successfully, 2 means extra files were found, and 8 or above means failures. Treat 0–7 as success in scripts.

What does the trailing slash do in rsync?

rsync /data/ dest copies the contents of /data into dest. rsync /data dest copies the folder itself, creating dest/data. It matters most with --delete.

Last updated 4 Dec 2026 · More in Sysadmin & Command Builders

More Sysadmin & Command Builders tools

See all →
Your product here. Reach IT engineers and architects who use these tools.Advertise →