[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

RoboCopy syntax help needed

Posted on 2013-10-31
7
Medium Priority
?
905 Views
Last Modified: 2013-11-15
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
Comment
Question by:PantoffelSlippers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 18

Accepted Solution

by:
Steven Harris earned 900 total points
ID: 39614980
copy:DATO is to retain Owner info.

use /COPYALL to retain all info.
0
 

Author Comment

by:PantoffelSlippers
ID: 39614989
Is the "T" in DATO not for timestamps?
0
 
LVL 18

Assisted Solution

by:Steven Harris
Steven Harris earned 900 total points
ID: 39614996
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
Industry Leaders: 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!

 

Author Comment

by:PantoffelSlippers
ID: 39615946
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
 

Author Comment

by:PantoffelSlippers
ID: 39615964
What does this switch do?

/is
Includes the same files.
0
 
LVL 18

Assisted Solution

by:Steven Harris
Steven Harris earned 900 total points
ID: 39616636
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
 

Author Closing Comment

by:PantoffelSlippers
ID: 39651841
My original script actually worked - I needed to refresh the destination folder before seeing the retained time stamps.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question