RoboCopy Log File

*爱你&永不变心* 提交于 2019-12-08 08:15:32

问题


Does anyone have any C# code that would help format the robocopy log file for easier upload to a database.

Sample log

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows                              
-------------------------------------------------------------------------------

  Started : Thu Jul 07 12:00:12 2011

   Source : C:\Sales\Out\
     Dest : \\Marketing\Data\In\

    Files : *.*

  Options : *.* /COPY:DAT /MOV /R:1000000 /W:30 

------------------------------------------------------------------------------

                       0     C:\Sales\In\
      *EXTRA File          1.4 m    2011MarketingMaster.XLS
      *EXTRA File          1.3 m    2011SalesOutput 01 .XLS
      *EXTRA File          1.4 m    2011SalesOutput 02 .XLS
      *EXTRA File          1.4 m    2011SalesOutput 03 .XLS
      *EXTRA File          1.4 m    2011SalesOutput 04 .XLS
      *EXTRA File          1.4 m    2011SalesOutput 05 .XLS
      *EXTRA File          1.4 m    2011SalesOutput 06 .XLS
      *EXTRA File          1.4 m    2011SalesOutput 07 .XLS
      *EXTRA File          1.4 m    2011SalesOutput 08 .XLS
      *EXTRA File          1.4 m    2011SalesOutput 09 .XLS
      *EXTRA File          1.4 m    2011SalesOutput 10 .XLS
      *EXTRA File          1.4 m    2011SalesOutput 11 .XLS
      *EXTRA File          1.4 m    2011SalesOutput 12 .XLS

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         0         1         0         0         0
   Files :         0         0         0         0         0       13
   Bytes :         0         0         0         0         0  461.67 m
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00

   Ended : Thu Jul 07 12:00:12 2011

回答1:


If you're interested in the files only, using the /NJH (no job header) and /NJS (no job summary) switches might make your work a lot easier: MSDN: Robocopy




回答2:


Thank you J. Tihon

/njh Specifies that there is no job header.

/njs Specifies that there is no job summary.



来源:https://stackoverflow.com/questions/6608337/robocopy-log-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!