5

I am using this command to save output to a file.

mongorestore --host %computerName%:%_portnumber% -u Admin -p user --oplogReplay %_sourceFolder% >> D:\Data\admin\abc.log

This creates an empty file and all the output is listed on the command prompt.

Is there a way to get the output to a file? Any help is greatly appreciated.

Daniel Schneller
  • 13,728
  • 5
  • 43
  • 72
user2386411
  • 113
  • 2
  • 9

1 Answers1

3

On Windows, I use below this

mongodump.exe /d test /o C:\Work 2> C:\temp\testdump.log

Actually, stream2 is STDERR but it works for MongoDB.

More info

Community
  • 1
  • 1
tao hiko
  • 113
  • 1
  • 11