Log only changes in robocopy output

2

I can't find a way to log only the changes in the output of a robocopy execution, i.e.: those considered new file, new directory, newer file, extra file, or extra directory.

The default output as I have it now consists of a list of all directories (touched or untouched) that were considered in the copying. I want to suppress the untouched.

Help doesn't seem to show a way to do this.

sasha

Posted 2017-05-02T08:13:43.970

Reputation: 213

What are the actual parameters you're using? Did you try with/without the verbose flag? – Seth – 2017-05-02T09:14:17.243

I use robocopy src dest /mir. As I understand it, /v is for showing skipped files (so, all of them), not what I am looking for. – sasha – 2017-05-02T12:40:44.867

Answers

5

If you carefully look at the documentation or robocopy /?, you will find the /NDL switch.

Specifies that directory names are not to be logged.

With this you will have no output on individual names for directories (which can be considered a type of progress marker). But "filenames" will include the path.

So for example you would get the following output:

        *EXTRA Dir        -1    C:\Temp\test\
          *EXTRA File                  0        C:\Temp\test\test.txt
100%        Newer                     72        C:\Temp\test.txt

Seth

Posted 2017-05-02T08:13:43.970

Reputation: 7 657

Great, thanks Seth. I must have misread the description for /ndl, thinking it meant something else. However, it would be nice for my purposes to also have a line in the output saying that a new directory in source was created since last mirroring. As is now, only locations to new files or as you mentioned extra items that were purged are printed. I use /LOG+:D:\backuplog.txt /TEE /NDL /NP /NS – sasha – 2017-05-02T13:36:49.843

You won't be able to get that input with the /NDL switch as far as I can tell. Form what I see neither switch combination would remove "just" the "unchanged" directories that are listed. You might be able to use some regular expression (lines with just white spaces and C: in the example?) to remove those lines using an editor that either supports it or a script. – Seth – 2017-05-02T14:06:30.017