Print the mongodump or mongorestore command to a log file

I use this command to save the 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 output is indicated on the command line.

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

+4
source share
1 answer

On windows I use below

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

Actually, stream2 is STDERR, but it works for MongoDB.

More details

+3
source

All Articles