Robocopy help

Associate
Joined
31 May 2014
Posts
521
I am going to test a batch file to run at shutdown to backup my documents to an external drive. I have the following syntax -

Robocopy c:\source c:\ destination /e /copy:dat /dcopy:t /log+:<LogFile>

I need some help though with the "/copy" flag. Seeing this is for a simple backup option I just want to keep the files in the destination the same as they are in the source. Is there any reason why I would want to use the /copy:dat over the /sec option or even the /copyall flag?
 
I didn't want to use the mirror switch as I want to delete files from the source and have them remain in the destination, will check out the linky though :)
 
You can most likely just leave it with /COPY:DAT which will copy all the useful information, and the files will then just inherit the NTFS permissions of where ever you're copying them to.

I think the issue is I don't really understand the implications of NTFS permissions or why I would want to copy them. Will take your suggestion that is probably isn't necessary.

You want this to run at shutdown? Shutdown will commence while this copy is in place

Aah I thought that it might run the batch file and shutdown once complete. I'll look into powershell and think in the meantime I may end up running the file copy manually from desktop, waiting until its done, and then shutting down.

Thanks for the tips.
 
Great stuff, thanks all. I have a couple further q's from all the advice -

it may be worth adding the /XO flag

From reading various online resources it says that when copying files this is the default option and thus not reqd, is this correct?

Probably also want to add /r:3

I'm only backing up personal docs, pics as opposed to anything system related so I'm assuming these shouldn't be locked?

I'm still confused whether upon shutdown, the pc will shutdown whilst robocopy is still copying files or wait until its finished? I assumed that I would need to start any script with shutdown /a to stop the shutdown and add the shutdown command at the end to end of the script to start it again but looking at bledd's script the /a switch isn't used.
 
Back
Top Bottom