gpt4 book ai didi

robocopy - 避免 Robocopy 日志中目标文件夹的现有文件详细信息

转载 作者:行者123 更新时间:2023-12-01 19:31:39 25 4
gpt4 key购买 nike

我想在使用 Robocopy 日志时避免所有现有文件名和目标文件夹的详细信息。

只想显示复制的文件列表及其详细信息。

因此,我可以通过避免日志中现有的文件详细信息来节省 robocopy 日志文件的大小。

有什么办法可以避免它,请帮忙

我看不到任何选项

Logging Options : ::

             /L :: List only - don't copy, timestamp or delete any files.
/X :: report all eXtra files, not just those selected.
/V :: produce Verbose output, showing skipped files.
/TS :: include source file Time Stamps in the output.
/FP :: include Full Pathname of files in the output.
/BYTES :: Print sizes as bytes.

/NS :: No Size - don't log file sizes.
/NC :: No Class - don't log file classes.
/NFL :: No File List - don't log file names.
/NDL :: No Directory List - don't log directory names.

/NP :: No Progress - don't display percentage copied.
/ETA :: show Estimated Time of Arrival of copied files.

/LOG:file :: output status to LOG file (overwrite existing log).
/LOG+:file :: output status to LOG file (append to existing log).

/UNILOG:file :: output status to LOG file as UNICODE (overwrite existing log).
/UNILOG+:file :: output status to LOG file as UNICODE (append to existing log).

/TEE :: output to console window, as well as the log file.

/NJH :: No Job Header.
/NJS :: No Job Summary.

/UNICODE :: output status as UNICODE.

最佳答案

默认情况下,robocopy 仅记录文件夹和不存在/修改(即复制)的文件。

          New Dir          2    C:\Temp\a\
100% New File 0 bar.txt
100% New File 0 foo.txt

您可以使用 /ndl 开关禁止记录文件夹(在这种情况下,复制的文件将及其完整路径列出)。

100%        New File                   0        C:\Temp\a\bar.txt
100% New File 0 C:\Temp\a\foo.txt

仅修改 foo.txt 并重新运行 robocopy a b/ndl 即可得到

100%        Newer                      3        C:\Temp\a\foo.txt

添加 /njh/njs 以从输出中删除标题和摘要。添加 /np 以删除进度指示(输出行开头的百分比值)。添加 /xx 以删除额外文件的指示(仅存在于目标文件夹中,但不存在于源文件夹中的文件):

C:\Temp><b>robocopy a b /njh /njs /ndl /np</b>

*EXTRA File 0 C:\Temp\b\baz.txt
New File 0 C:\Temp\a\bar.txt
New File 0 C:\Temp\a\foo.txt

C:\Temp><b>echo "foo" >a\bar.txt</b>

C:\Temp><b>robocopy a b /njh /njs /ndl /np /l</b>

*EXTRA File 0 C:\Temp\b\baz.txt
Newer 3 C:\Temp\a\bar.txt

C:\Temp><b>robocopy a b /njh /njs /ndl /np /xx /l</b>

Newer 8 C:\Temp\a\bar.txt

关于robocopy - 避免 Robocopy 日志中目标文件夹的现有文件详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16108640/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com