Make backup script with robocopy for Windows

Mirror the directories (source & destination exactly the same)

robocopy \\SourceServer\Share \\DestinationServer\Share /MIR /FFT /Z /XA:H /W:5 /MT /NP /LOG:C:\location\log.txt

 

/MIR specifies that robocopy should mirror the source directory and the destination directory. Note that this will delete files at the destination if they were deleted at the source.

/MIR 

 

/FFT uses fat file timing instead of NTFS. This means the granularity is a bit less precise. For across-network share operations this seems to be much more reliable – just don’t rely on the file timings to be completely precise to the second.

/FFT

/Z ensures robocopy can resume the transfer of a large file in mid-file instead of restarting.

/Z

/XA:H makes robocopy ignore hidden files, usually these will be system files that we’re not interested in.

/XA:H

/W:5 reduces the wait time between failures to 5 seconds instead of the 30 second default.

/W:5

 

/MT Multi-threaded (default is 8)

/MT:16

/NP No percentage 

/NP

 

/LOG  

/LOG:C:\location\log.txt

Leave a Comment

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