1

Is there any way to tell robocopy to log all the info but to show the header/summary (any high level info really)?

I did some screwing around and when I used the NFL option for example, it actually didnt copy the files, it just created the directories, which is really confusing to me.

Im doing this in powershell since im going to have it manage the copies a bit, but what i've done so far is really straight forward.

#clean up for test
rm E:\temp -Recurse -Force

$src = "e:\website"
$dest = "e:\temp"

$cmd = gcm robocopy
$logOptions ="nfl", "ndl","/ns","/nc", '/log:e:\copy.log', "/tee"
$options = "/e", "/copyall", "/zb", "/r:2", "/w:1"

& $cmd $src $dest $options $logOptions

It runs robocopy just fine, but as i said its not copying the files. In the Header it shows the following info.

Files : nfl
        ndl

Options : /NS /NC /TEE /S /E /COPYALL /ZB /R:2 /W:1 

Which also seems odd because based on the docs the nfl/ndl are logging options, not copy options.

The file version is 10.0.10586, which is what comes with windows 10. thoughts?

jrich523
  • 111
  • 1
  • 2
  • Did you perhaps forget to preped `nfl` and `ndl` with a `/`, making them `/nfl` and `/ndl`? – GregL May 12 '16 at 17:29

1 Answers1

1

You want to log everything, but then display only the header and the summary info?
Go with what you've got, leaving out the /NFL /NDL.
I also recommend using "/NP", otherwise the log is cluttered with 1%... 2%... 3%...
When the job is done, use this:

gc E:\copy.log | select -first 15
gc E:\copy.log | select -last 10

Edit after comment
Confused... your original post said "...log all the info but show...". If you truly do NOT want to log all info use /NFL /NDL. If you want to only list what job would do without actually doing the copy use /L. What you did so far did not copy anything because you omitted the slash on NFL and NDL, which turned them into file name matching parameters, and you had no files in the source that matched those patterns.

Clayton
  • 4,483
  • 16
  • 24
  • Im looking at migrating a NAS which means if i do that those files will be large. Because of how PS works, those Select's will get messy, but there are ways around that. Mostly I just wanted to avoid touching the files – jrich523 May 12 '16 at 19:20