Robocopy question

Associate
Joined
16 Nov 2007
Posts
811
Hello

I wish to run a script once a week that backs up data on my server to a NAS drive. I wish for the NAS drive to be a complete mirror of the server i.e. if a file is deleted from the server, it gets deleted from the NAS at time of initiating the backup.

I have assumed the most efficient way to do this is create a Robocopy script and assign it to run via Task Scheduler on the server.

Assuming so, I have created the following .cmd script

robocopy "\\SERVER\Temp" "\\STORAGE\Temp" /E /PURGE /V /NP /R:10 /W:30
robocopy "\\SERVER\ycambg" "\\STORAGE\ycambg" /E /PURGE /V /NP /R:10 /W:30

... and so on for each folder I wish to back up.

I've just undertaken a dummy run of this script and set it to run via task scheduler. All appears to work as planned.

This is the first time I've played with such a thing. Can anyone more experienced than I confirm this is an acceptable way of achieving my goal, have I overlooked something or are there any more efficient alternatives?

Thanks for your time,

Mike
 
Looks good, although the /MIR switch is the same as /E /PURGE, and /W:30 is redundant as Robocopy waits 30 seconds between retries by default anyway.

If the NAS drive has a Linux filesystem and you're copying from a Windows/NTFS server, you might need to add the /FFT switch to allow for the difference in file timestamp granularity - if you don't do this, you could end up copying the whole lot every time instead of just new/changed files.
 
Back
Top Bottom