robocopy -- copy /w

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Oct 18, 2008
265
1
#1
Hello – Not sure how to debug this but I been using robocopy to mirror folders from my computer to local NAS storage. I guess for the most part these small NAS units run some version of Linux and samba for windows network access -

I started to notice that when I would just a clone from my windows 7 32bit os computer to the NAS, robocopy would always copy source files to the target.

I then tried using “copy” with the /w switch – would “do the right thing” and only copy the changed files and delete the files on the target not on the source.

I did the same robocopy job on a different windows7 computer (64bit OS) and it worked correctly on that system.

The copy of robocopy on the 32bit OS is version is 6.1.7601.23403 – the version that worked is 5.1.10.1027 on the other win7 computers – I think that the later version could be part of a win7 rollup fix

In the case of “copy” with the “/w” switch is the test for the file(s) to be copied if the timestamp of the source is later than the target or the filessize are different?

Any pointers on how to debug this or submit it to microsoft as a bug would be appreciated
 
Oct 18, 2008
265
1
#3
Hello – Thanks for the reply ... Think that I have used those switches in the pass with NO success – I went as far to write a (take) batch file to use the @fileage function to look at the time stamps of the files in bot the source and target folder –

fileage returned the 64bit timestamp as a decimal value and in all cases, the modified time was exactly the same. What is curious about the robocopy log its that there is no “tag” on why the file was copied – usually one would see the tag “newer” “new file” “changed” .... etc – so there must be some other test that robocopy is using to do the copy.

As noted the version of robocopy that was not working seems to be connected to a fix KB2639043 which had something to do with ACL’s – I am not to sure how NAS/Samba handles CACLS – Thanks again
 

rconn

Administrator
Staff member
May 14, 2008
10,292
90
#5
In the case of “copy” with the “/w” switch is the test for the file(s) to be copied if the timestamp of the source is later than the target or the filessize are different?
COPY /W doesn't test the target, it just copies everything from the source directory. If you want to only copy updated files, you need to add the /U option (which uses the timestamp). Or maybe the /C and/or /R options, depending on what you're trying to accomplish.
 
Oct 18, 2008
265
1
#6
Thanks for the info -- Yes I used the copy like this to result in a one way mirror of the source folder ---

copy /s /u /g /w c:\source k:\target

is it just the time stamp that is tested? what about the file size? with respect to the TS is it just the "modified" value that is use? and its a comparison of the 64bit values?
 

rconn

Administrator
Staff member
May 14, 2008
10,292
90
#8
Thanks for the info -- Yes I used the copy like this to result in a one way mirror of the source folder ---

copy /s /u /g /w c:\source k:\target

is it just the time stamp that is tested? what about the file size? with respect to the TS is it just the "modified" value that is use? and its a comparison of the 64bit values?
It's the modified time stamp that is used. File size is not compared. The comparison depends on the file system; for NTFS it is 64-bit FILETIME values.