Robocopy仅输出复制的文件

时间:2014-12-14 16:40:47

标签: powershell synchronization powershell-v3.0 robocopy

我有以下Robocopy命令。目前它输出它在镜像期间遍历的所有目录,但我只希望它输出实际从源到目的地同步的内容。我没有看到"只显示差异" the documentation中的选项。

robocopy "C:\inetpub\example.com" "Z:\D Drive\Projects\example.com\Web\example.Web" /mir /xd "C:\inetpub\example.com\wp-content\mu-plugins\example-network" "C:\inetpub\example.com\wp-
content\plugins\example" "C:\inetpub\example.com\wp-content\themes\example" ".git"

1 个答案:

答案 0 :(得分:0)

当然我在发布问题后立即知道了。这是我的新命令。 / fp / ns / ndl 选项可以解决问题。

robocopy "C:\inetpub\example.com" "Z:\D Drive\Projects\example.com\Web\example.Web" /mir /fp /ns /ndl  /xd "C:\inetpub\example.com\wp-content\mu-plugins\example-network" "C:\inetpub\example.com\wp-content\plugins\example" "C:\inetpub\example.com\wp-content\themes\example" ".git"

开关的含义

来自SS64 entry

/FP : Include Full Pathname of files in the output.
[...]
/NS : No Size - don’t log file sizes.
[...]
/NDL : No Directory List - don’t log directory names.