robocopy -- copy /w

Oct 18, 2008
339
2
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
 
Nov 13, 2008
255
3
www.thedave.me
Depending on the NAS, you might want to try either of /FFT or /DST. Even though the NAS probably doesn't use FAT, it may not store the same granularity as NTFS and this switch might help.
 
Oct 18, 2008
339
2
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
12,345
150
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
339
2
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
12,345
150
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.
 
Similar threads
Thread starter Title Forum Replies Date
K copy /w slow relative to robocopy /mir Support 0
K robocopy cancelling batch file processing Support 28
C Copy (sys) error Support 3
Alpengreis Fixed Crash after copy dialog with big TCC.exception.log Support 5
vefatica Copy/Paste anomaly Support 4
D Documentation Typo in COPY help Support 0
samintz COPY fails to copy from \\wsl$ Support 20
D Differences between TCC and CMD with COPY /b Support 4
fpefpe copy /u and timestamps Support 4
M Strange error messages from TCC in FTP copy Support 7
G TCMD crash when copy Support 3
Alpengreis How to? Copy DIRs with attributes ... Support 4
E Text copy bug Support 1
Alpengreis [TCMD v25.00.24] Problem with copy and paste and the # char via mouse in TCC Support 6
fpefpe copy/cat Support 7
Jay Sage Problem with Context Menu Copy+Paste+Run Key Assignment Support 7
K "copy /z /w" command not deleting read-only files in destination Support 10
K copy changing destination current directory Support 1
D Keystroke to copy previous argument Support 3
A How to? Copy+Paste in TCMD tabs with Ctrl-Shift-Ins? Support 5
RChrismon How to? Copy TCMD.INI to New Version Support 7
R How to? Append files in multiple subfolders using copy? Support 8
Dick Johnson COPY /u (?) Support 9
fpefpe Documentation copy /u Support 7
R How to? copy /q ABC.txt + DEF.txt is appending hex 1A Support 8
D copy /g only shows transfer rate Support 1
J Error "Contents lost before copy" Support 3
B Can copy command concatenate multiple mp3 files Support 2
rps Documentation "Copy+Paste+run" question Support 2
kb6ojs Make /G parameter persistent in COPY/MOVE command? Support 4
fpefpe How to? copy / exclude Support 2
C copy /w /p prompts for deletion, but ... Support 3
D Fixed Copy Support 1
fpefpe Documentation copy/move using /c or /u Support 2
samintz WAD Copy/append adds a character Support 3
P Simple RegEx copy Support 9
fromano Fixed COPY ... TO ... crashing Support 3
Alpengreis How to? Copy & Paste without linebreak within TCMD Support 13
D COPY returns ERRORLEVEL 2 Support 5
mdwyer TCC 13 COPY: specified network name is no longer available. Support 5
CWBillow Copy a tree Support 17
J junction copy/move handling Support 6
vefatica Fixed COPY /S ftp://... Support 1
C WAD copy /u ftp local with Timeout? Support 5
D How to? Unregister a copy of Take command Support 1
vefatica FTP copy interrupted Support 2
C How to? COPY ftp folder query Support 7
R How to? TCC 16.03: copy a file to the clipboard? Support 10
jadaml Documentation Is COPY realy doesn't work for any HTTP and FTP? Support 3
T TCC control-C copy operation Support 3

Similar threads