我有15个以上的数据文件,我试图用robocopy强制覆盖。我使用以下命令行开关:
C:\>robocopy d:\datafolder f:\backup datafile*.dat /is /fft /MT:32
15个文件按预期成功复制。
我立即运行以下命令,希望看到所有15个文件都被覆盖,但是4显示要被跳过的“已修改”状态。
C:\>robocopy d:\datafolder f:\backup datafile*.dat /is /fft /MT:32 /v /l
以下是两次执行的日志:
C:\>robocopy d:\datafolder f:\backup datafile*.dat /is /fft /MT:32 ------------------------------------------------------------------------------- ROBOCOPY :: Robust File Copy for Windows ------------------------------------------------------------------------------- Started : Thursday, December 22, 2016 11:35:45 AM Source : d:\datafolder\ Dest = f:\backup\ Files : datafile*.dat Options : /FFT /DCOPY:DA /COPY:DAT /IS /MT:32 /R:1000000 /W:30 ------------------------------------------------------------------------------ 100% New File 1.0 g d:\datafolder\datafile0.dat 100% New File 1.0 g d:\datafolder\datafile00.dat 100% New File 1.4 g d:\datafolder\datafile01.dat 100% New File 600.0 m d:\datafolder\datafile1.dat 100% New File 2.0 g d:\datafolder\datafile11.dat 100% New File 2.0 g d:\datafolder\datafile12.dat 100% New File 2.0 g d:\datafolder\datafile13.dat 100% New File 500.0 m d:\datafolder\datafile2.dat 100% New File 700.0 m d:\datafolder\datafile3.dat 100% New File 500.0 m d:\datafolder\datafile4.dat 100% New File 600.0 m d:\datafolder\datafile5.dat 100% New File 600.0 m d:\datafolder\datafile6.dat 100% New File 1.0 g d:\datafolder\datafile7.dat 100% New File 1.0 g d:\datafolder\datafile8.dat 100% New File 1.0 g d:\datafolder\datafile9.dat ------------------------------------------------------------------------------ Total Copied Skipped Mismatch FAILED Extras Dirs : 1 1 1 0 0 0 Files : 15 15 0 0 0 0 Bytes : 15.882 g 15.882 g 0 0 0 0 Times : 1:57:36 0:09:00 0:00:00 0:00:49 Ended : Thursday, December 22, 2016 11:45:35 AM C:\>robocopy d:\datafolder f:\backup datafile*.dat /is /fft /MT:32 /v /l ------------------------------------------------------------------------------- ROBOCOPY :: Robust File Copy for Windows ------------------------------------------------------------------------------- Started : Thursday, December 22, 2016 11:45:50 AM Source : d:\datafolder\ Dest = f:\backup\ Files : datafile*.dat Options : /FFT /V /L /DCOPY:DA /COPY:DAT /IS /MT:32 /R:1000000 /W:30 ------------------------------------------------------------------------------ modified 600.0 m d:\datafolder\datafile1.dat modified 500.0 m d:\datafolder\datafile2.dat modified 700.0 m d:\datafolder\datafile3.dat modified 500.0 m d:\datafolder\datafile4.dat 100% Same 1.0 g d:\datafolder\datafile0.dat 100% Same 1.0 g d:\datafolder\datafile00.dat 100% Same 1.4 g d:\datafolder\datafile01.dat 100% Same 2.0 g d:\datafolder\datafile11.dat 100% Same 2.0 g d:\datafolder\datafile12.dat 100% Same 2.0 g d:\datafolder\datafile13.dat 100% Same 600.0 m d:\datafolder\datafile5.dat 100% Same 600.0 m d:\datafolder\datafile6.dat 100% Same 1.0 g d:\datafolder\datafile7.dat 100% Same 1.0 g d:\datafolder\datafile8.dat 100% Same 1.0 g d:\datafolder\datafile9.dat ------------------------------------------------------------------------------ Total Copied Skipped Mismatch FAILED Extras Dirs : 1 1 1 0 0 0 Files : 15 11 4 0 0 0 Bytes : 15.882 g 13.636 g 2.246 g 0 0 0 Times : 0:00:00 0:00:00 0:00:00 0:00:00 Ended : Thursday, December 22, 2016 11:45:50 AM
任何人都知道为什么这4个文件显示为已修改并因此被跳过?
答案 0 :(得分:1)
可能的问题是这些文件对于robocopy是相同的 - 如果时间戳和文件大小相同,则robocopy将不会复制/移动文件。要移动或复制此类文件,您必须添加/IT
选项:
/IT :: Include Tweaked files - A Tweaked file is defined to be one that exists in both the source and destination, with identical size and timestamp, but different attribute settings.
要阅读的一些链接:
How does Robocopy determine if a file is “changed”,