ITPub博客

首页 > 自动化运维 > 应用服务器 > [20220329]windows xcopy命令问题.txt

[20220329]windows xcopy命令问题.txt

原创 应用服务器 作者:lfree 时间:2022-03-28 09:15:47 0 删除 编辑

[20220329]windows xcopy命令问题.txt

--//需要同步U盘的一个文件,使用xcopy命令,遇到的问题做一个记录.
--//我习惯性输入如下:
--//cmd 版本如下:
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

g:\> xcopy /d/e/y g:\blog\jd.txt u:\blog

--//文件很小,如果需要拷贝更新应该很快完成.可是我等了很久一直都没有完成.
--//使用sysinternals自带的Procmon.exe跟踪发现:

"Time of Day","Process Name","PID","Operation","Duration","Path","Result","Detail","TID","Parent PID"
"16:27:45.9604751","xcopy.exe","1176","CreateFile","0.0001131","G:\blog\XXXTTT.com","SUCCESS","Desired Access: Generic Read, Disposition: Open, Options: Sequential Access, Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: Read, AllocationSize: n/a, OpenResult: Opened","1812","884"
"16:27:45.9606854","xcopy.exe","1176","QueryAttributeTagFile","0.0000274","G:\blog\XXXTTT.com","SUCCESS","Attributes: DAC, ReparseTag: 0x0","1812","884"
"16:27:45.9607712","xcopy.exe","1176","QueryStandardInformationFile","0.0000204","G:\blog\XXXTTT.com","SUCCESS","AllocationSize: 0, EndOfFile: 0, NumberOfLinks: 1, DeletePending: False, Directory: True","1812","884"
"16:27:45.9608268","xcopy.exe","1176","QueryBasicInformationFile","0.0000165","G:\blog\XXXTTT.com","SUCCESS","CreationTime: 2019-11-10 9:22:08, LastAccessTime: 2022-3-27 16:25:44, LastWriteTime: 2022-2-21 20:06:52, ChangeTime: 2022-3-26 8:22:54, FileAttributes: DAC","1812","884"
"16:27:45.9609187","xcopy.exe","1176","QueryStreamInformationFile","0.0000615","G:\blog\XXXTTT.com","SUCCESS","","1812","884"
"16:27:45.9610550","xcopy.exe","1176","QueryBasicInformationFile","0.0000179","G:\blog\XXXTTT.com","SUCCESS","CreationTime: 2019-11-10 9:22:08, LastAccessTime: 2022-3-27 16:25:44, LastWriteTime: 2022-2-21 20:06:52, ChangeTime: 2022-3-26 8:22:54, FileAttributes: DAC","1812","884"
"16:27:45.9611475","xcopy.exe","1176","QueryEaInformationFile","0.0000246","G:\blog\XXXTTT.com","SUCCESS","EaSize: 0","1812","884"
"16:27:45.9699584","xcopy.exe","1176","CreateFile","0.0035851","U:\blog\XXXTTT.com","SUCCESS","Desired Access: Read Data/List Directory, Write Data/Add File, Write EA, Read Attributes, Write Attributes, Delete, Synchronize, Disposition: OpenIf, Options: Directory, Synchronous IO Non-Alert, Attributes: DAC, ShareMode: None, AllocationSize: 0, OpenResult: Opened","1812","884"
"16:27:45.9736876","xcopy.exe","1176","QueryBasicInformationFile","0.0000213","U:\blog\XXXTTT.com","SUCCESS","CreationTime: 2019-11-9 22:32:13, LastAccessTime: 2022-3-25 0:00:00, LastWriteTime: 2022-2-21 20:06:52, ChangeTime: 1601-1-1 8:00:00, FileAttributes: DA","1812","884"
"16:27:45.9737815","xcopy.exe","1176","QueryAttributeInformationVolume","0.0000355","U:\blog\XXXTTT.com","SUCCESS","FileSystemAttributes: Case Preserved, Unicode, MaximumComponentNameLength: 255, FileSystemName: FAT32","1812","884"
"16:27:45.9738731","xcopy.exe","1176","QueryBasicInformationFile","0.0000146","U:\blog\XXXTTT.com","SUCCESS","CreationTime: 2019-11-9 22:32:13, LastAccessTime: 2022-3-25 0:00:00, LastWriteTime: 2022-2-21 20:06:52, ChangeTime: 1601-1-1 8:00:00, FileAttributes: DA","1812","884"
"16:27:45.9739527","xcopy.exe","1176","QueryAttributeInformationVolume","0.0000545","G:\blog\XXXTTT.com","SUCCESS","FileSystemAttributes: Case Preserved, Case Sensitive, Unicode, ACLs, Compression, Named Streams, EFS, Object IDs, Reparse Points, Sparse Files, Quotas, MaximumComponentNameLength: 255, FileSystemName: NTFS","1812","884"
"16:27:45.9741947","xcopy.exe","1176","SetBasicInformationFile","0.0103901","U:\blog\XXXTTT.com","SUCCESS","CreationTime: 1601-1-1 8:00:00, LastAccessTime: 1601-1-1 8:00:00, LastWriteTime: 1601-1-1 8:00:00, ChangeTime: 1601-1-1 8:00:00, FileAttributes: DAC","1812","884"

--//xcopy在扫描g:\blog的各个子目录来同步U:\blog目录.
--//我在U盘建立一个bblog目录再次尝试.

G:\>xcopy /d/e/y g:\blog\jd.txt u:\bblog
G:\blog\jd.txt
--//等上一小会,马上按ctrl+c中断.

d:\notes>dir u:\bblog /b
jd.txt
0x.tools
.....

G:\>xcopy /?
...
  /E           复制目录和子目录,包括空的。
               与 /S /E 相同。可以用来修改 /T。

--//windows的xcopy命令真变态,实际上xcopy /e参数还把其他目录下的文件做了同步以及检查,实际上上面的命令正确的执行方式是
G:\>xcopy /d/y g:\blog\jd.txt u:\bblog
复制了 0 个文件

--//这样很快完成.提示"复制了 0 个文件"是因为现在两边文件一致无需要做同步处理.
--//怪不得,我写的同步脚本同步开始时有点慢,原来是扫描子目录的原因.
--//链接 http://blog.itpub.net/267265/viewspace-2137969/ =>[20170425]实现磁盘文件与U盘同步.txt


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-2884435/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    4006
  • 访问量
    7969412