glennda Posted December 17, 2012 Posted December 17, 2012 Does anybody have a script that will merge two folders together but only transfer files from the first folder with they don't exist or are newer then those in the second? Trying to do a bit of a botch restore of data!
Steve21 Posted December 17, 2012 Posted December 17, 2012 robocopy Source Dest /S /XO Is include subfolders, and exclude older. /XO : eXclude Older - if destination file exists and is the same date or newer than the source - don’t bother to overwrite it. Steve 1
glennda Posted December 17, 2012 Author Posted December 17, 2012 I've tried that but for some reason this server tries to add /e /xo as \e \xo on the path? Any ideas?
Steve21 Posted December 17, 2012 Posted December 17, 2012 Whats the original command you're running? Steve
glennda Posted December 17, 2012 Author Posted December 17, 2012 robocopy F:\restore\project\ "F:\projects\Project Directory\" /S /XO Just seems to be swapping the /s /xo for \s \xo??
Steve21 Posted December 17, 2012 Posted December 17, 2012 The \ is the problem. robocopy "F:\restore\project" "F:\projects\Project Directory" /S /XO Steve
Steve21 Posted December 17, 2012 Posted December 17, 2012 Adding the \ + Robocopy's own \ makes it escape char ", such that you actually use it in the string Steve
glennda Posted December 17, 2012 Author Posted December 17, 2012 Adding the \ + Robocopy's own \ makes it escape char ", such that you actually use it in the string Steve Thanks!! Running now - I had tried removing the \ from the source but not destination.
penfold Posted January 10, 2013 Posted January 10, 2013 Not quite the same, but I've copied user home files over to a new server but before we move the users over I want to run robocopy again to pickup any of the files which have been updated or created while we have done this. Can I just add the switch /s /xo to my existing command so I don't copy everything again?
Steve21 Posted January 10, 2013 Posted January 10, 2013 Not quite the same, but I've copied user home files over to a new server but before we move the users over I want to run robocopy again to pickup any of the files which have been updated or created while we have done this. Can I just add the switch /s /xo to my existing command so I don't copy everything again? It'll exclude older files (and same etc), but only if in same position etc. If I move ABC.doc into a folder, it's a new file etc, but in terms of what you're saying yes it should do it Make sure it's upper case though, think there's lower case on robocopy too Steve 1
penfold Posted January 10, 2013 Posted January 10, 2013 I did run a quick test and it seemed to work, but I used lower case so will change that in case it causes problems before running it with live data. Thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now