We help IT Professionals succeed at work.

Robocopy Log. List only New folders Created.

hgj1357
hgj1357 asked
on
Medium Priority
94 Views
Last Modified: 2019-10-17
Robocopy.  Is it possible to generate a report / log file that only shows the new folders created as part of a particular copy run?  The verbose log lists every folder and file touched and uses "new dir" to indicate a new folder, but given that this verbose log is >95,000 lines that can be cumbersome.
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018
Commented:
Well, if you only want new directories, then start with not using /V
Then add /NFL (No File List) to prevent logging of individual files.
That's as close as you get if you write directly to a log file using the /LOG argument.
If you redirect the output, you can pipe it to find.exe, you can use something like this:
robocopy.exe ... /NP /NFL | find.exe /i "new dir" >robocopy.log

Open in new window

Or if you want to filter an existing log:
find.exe /i "New Dir" robocopy.log

Open in new window

Bill PrewTest your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016

Commented:
I'm in a similar thought place as oBdA, but I would approach it by filtering out the "New File" lines and leaving the rest, so you get the totals and errors, etc.  Like:

find.exe /v /i " New File " robocopy.log

Open in new window


»bp

Author

Commented:
Thanks.  find.exe /i "New Dir" robocopy.log works a treat.