Robocopy backup script query

Associate
Joined
16 Nov 2007
Posts
811
Hello

I am in the process of writing some scripts to automatically backup my home server data to other remote drives. I am planning to use Robocopy commands in a script set to run via task scheduler.

It's the first time I've played with such a thing and have noticed a warning in the guide linked below

http://www.sevenforums.com/tutorials/187346-robocopy-create-backup-script.html

The warning suggests that the "MIR" option (and presumably using /E and /PURGE) could delete files from the source folder. This is naturally of concern to me.

In testing my scripts though, I cannot seem to replicate an instance of deleting files from the source folder.

Is the guide factually incorrect or could Robocopy introduce such a problem?

A sample of one of my commands is pasted below for reference.

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

I posted in here as I'm assuming this sub-forum attracts more users who use such commands. I originally posted a query in the Windows forum but didn't receive much response.

Thank you for your time,

Mike
 
Thank you both very much for your replies.

I can't seem to get the script to work with the extra switches you mention, not sure why but I'll explain my installation / intended usage for context. For example, I started with my base script and added the /COPYALL switch but it failed to work, likewise adding in the /ZT and /MT switches.

I have a Windows home Server 2011 installation with the hostname of "server", the shared folders of which I wish to back up on a 2 weekly basis to a Thecus NAS drive with hostname "backup".

I therefore regard "server" as the source and "backup" as the target.

** To confirm. I wish for the "backup" files to be a direct mirror of what is on the "server" at time of copying, even if that means files on "backup" are deleted because they have been deleted on "server" some time in the past 2 weeks.

I've modified my script as below

robocopy "\\SERVER\Temp" "\\BACKUP\Temp" /E /PURGE /V /NP /R:3 /W:5 /LOG:"\\BACKUP\Temp\~Backup Log.txt"

This has been tested and (appears to) meet my needs.

What I'm worrying about though and what I still don't understand, is that you (Yamahahahahaha) have indicated that the /PURGE switch has the ability to delete files from the source as opposed to the target. Are you 100% certain of this? If so, please can you let me know how to replicate this for testing purposes?

Just to confirm, I'm 100% happy with files being deleted from the target folders, that is my proposed usage, to have a direct mirror of what is contained on the source.

Thank you for your time and sorry to question your feedback, I just want to be 100% certain before I role it out and rely on it!

Thank you

Mike
 
...
Ah, just read your reply... Thecus. Caused me so much grief I ended up selling mine and buying a micro Proliant for £120 less than I got for the NAS! Yes, Thecus have broken robocopy for all us end users. I say vote with your keyboard and open a support job with them and harass them until they admit they broke it and they aren't going to fix it, then sell it and tell them you're telling all your friends never to buy Thecus.

Thank you for this insight. This explains why I couldn't get Robocopy to work properly between my server and NAS. As you say, one of the problems was the fact that it tried to copy every single file instead of incremental.

Freefilesync appears to do everything I need. I've created a script and rolled it out last night.

Thank you all.

Mike
 
Back
Top Bottom