Robocopy switches

Soldato
Joined
20 Oct 2002
Posts
19,510
Location
London
I was just wondering if anyone could check this robocopy script I have. It's basically to copy office files.

robocopy "F:\Office" "Z:\Office Backup" *.* /S /IS
I just wanted to check the switches I'm using. I'd like it to do the following:

- Ensure modified files are updated/copied again
- Log results of files moved successfully (I couldn't figure this out?)
- Not delete files on the backup drive that have been deleted from the original

Is what I've got essentially right (minus the log?)

Thanks.
 
robocopy "F:\123" "F:\12345" /e

that's what I use.

What do you mean by log results mate, do you want a txt file log output?

/LOG+:c:\log.txt
 
Thanks guys. I've done more work on my script(s) and have got the following working really well, complete with nice logs.

Code:
robocopy "F:\source" "P:\destination" *.*  /XD dirs $RECYCLE.BIN "System Volume Information" /IS /E /V /TEE /XA:SHT /NP /LOG:"G:\BACKUP LOGS\My Log.txt"

However even though I have the following switches:

/XA:SHT
/XD dirs $RECYCLE.BIN "System Volume Information"

On one of the copies I keep getting the specified^ directories copied, which are hidden/system folders. And also one of my backups keeps changing itself to a hidden/system folder which I can only see when I change my viewing options to not "hide protected operating system files". This is annoying when I want to just quickly look that the files have copied.

Any ideas? Can I change the copied files from system files? :)
 
Last edited:
just type /XD "$RECYCLE.BIN"

leave out the 'dirs' bit

I think MS say it's a good idea not to robocopy a root dir (may be able to get around it using excludes though)
 
Back
Top Bottom