Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 934
  • Last Modified:

RoboCopy syntax help needed

Hi experts,

I have a list of files that I need to copy from various locations on a windows network into one folder on another windows file server.

I need to retain the file owner, create date and modify date.

Based on my research and google searches, RoboCopy is the most suitable tool for the job.

However, I cannot get it to retain the create date.  I'm using the following command:

RoboCopy /"\source location\/" /"\destintion location\/" "file name" /copy:DATO /dcopy:T /ts /fp /r:0 /tee /log:C:\testlog.txt

Based on my research, the parameter "/copy:DATO" should allow me to retain all dates but it's not working.  Please help me correct this.

My 2nd question is:  if there are two files with the same name in the source locations which I'm now trying to copy into the same destination folder, how will roboCopy handle that?  Do I have options available to prompt, ore replace, or skip or rename?

I'm running the command on a Windows 7 machine.

Many thanks
0
PantoffelSlippers
Asked:
PantoffelSlippers
  • 4
  • 3
3 Solutions
 
Steven HarrisPresidentCommented:
copy:DATO is to retain Owner info.

use /COPYALL to retain all info.
0
 
PantoffelSlippersAuthor Commented:
Is the "T" in DATO not for timestamps?
0
 
Steven HarrisPresidentCommented:
It is, but you also have other switches that are interfering.

Try the following:

RoboCopy "source" "destination" "file name" /COPYALL /XO /TS /FP /R:0 /TEE /LOG:C:\testlog.txt

Open in new window



/XO answers the second question:

/XO : eXclude Older - if destination file exists and is the same date or newer than the source - don’t bother to overwrite it.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
PantoffelSlippersAuthor Commented:
Thank you,

Is XO the only option available in terms duplicate names in the destination folder?

I know that there are files that have the same name but the content is not necessarily the same.  Is there a way to retain both copies in the destination directory?

Thanks again
0
 
PantoffelSlippersAuthor Commented:
What does this switch do?

/is
Includes the same files.
0
 
Steven HarrisPresidentCommented:
Is XO the only option available in terms duplicate names in the destination folder?
Not exactly sure what you mean by this one, but there is also /XC, /XN, /XL ...

I know that there are files that have the same name but the content is not necessarily the same.  Is there a way to retain both copies in the destination directory?

What is the final outcome you are looking to obtain?  Merging all files from multiple sources into a single folder?  Are you wanting to keep the same folder structures?

What does this switch do?

/is
Includes the same files.

/IS : Include Same, overwrite files even if they are already the same.

You do not want the /IS switch.
0
 
PantoffelSlippersAuthor Commented:
My original script actually worked - I needed to refresh the destination folder before seeing the retained time stamps.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now