General discussion

Locked

Why does XCOPY /D not always work

By T. Good ·
I am using XCOPY to backup files from my c: drive to a file server. I only want to copy files that are newer on my source drive than on my destination drive. I'm using the /D option. There are 6 files in my source folder. Everytime I execute the command, 2 of the 6 files are copied even though the modified date and time on the source and destination folder are the same. Why is this happening?

xcopy "C:\techword save\*.*" q:\AllProj\special\ /d > q:\AllProj\xcopypwd.log

The source file has the following file types:
.bak
.exe
.dat
.hlp
.txt
.cnt

The two files that get copied each time are the .bak and .dat files.

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Why does XCOPY /D not always work

by BudTheGrey In reply to Why does XCOPY /D not ...

It could be that XCOPY is looking at the entire date-time stamp, so a difference of 1 second is sgnificant. Also, there are really two date-time stamps on a file -- when it was created, and when is was last modified. I'm not sure which one XCOPY uses (the latter, I think)

Why not use the /M switch? This checks for files with the archive attribute turned on, copies them, then turns it off. That way, XCOPY only picks up the files you've updated.

Collapse -

Why does XCOPY /D not always work

by T. Good In reply to Why does XCOPY /D not ...

The /M command solved my problem and works reliably.

Collapse -

Why does XCOPY /D not always work

by KhongPhuTu In reply to Why does XCOPY /D not ...

Hi,

You need to be more specific. Lacking the specific, I presume q: is a network drive.

It could be problem with permision and audit settings. Check out this from MS:

"Preserving Permissions and Audit Settings
To copy files while retaining current Windows permissions and audit settings, you can use the XCopy utility that comes with Windows 2000 Server, by typing the following at the command prompt:

XCopy <current><dir> <new><dir> /o /a /s "

Regards,

Collapse -

Why does XCOPY /D not always work

by T. Good In reply to Why does XCOPY /D not ...

Poster rated this answer

Collapse -

Why does XCOPY /D not always work

by T. Good In reply to Why does XCOPY /D not ...

This question was closed by the author

Back to Windows Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums