Quick Tips: Seamless network backup for windows terminal

Create a text file backup.cmd (Notepad Save As > Change Text File dropdown  to All files)  and add a single line per backup source. Double-click to run.

robocopy.exe \\192.168.0.1\source D:\destination /MIR /ZB /XF *.exe *.pdf /XD "\\192.168.0.1\source\dir1" "\\192.168.0.1\source\dir2" /LOG+:log.txt /TEE

pause

Options:

  1. /S – copy subfolders
  2. /ZB – Copy files in restartable mode, else Backup mode
  3. /XF – Skip, Exclude File patterns e.g. *.exe
  4. /XD – Skip, Exclude directories. No trailing backslash.
  5. /LOG+: log.txt – Log to file log.txt
  6. /MIR – Create an exact copy (Warning: deletes data from destination that does not exist on source)
  7. /TEE – Used with /LOG to enable console logging