Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start MongoDB as a Daemon without having to write log

Tags:

mongodb

Is there a remote (ssh) way to simulate the:

mongod --fork --logpath /var/log/mongodb.log

without the logging part? If I ommit the logpath mongod will complain.

I'm having it running on a RaspberryPi and I'd like to turn the logging off to maximize the SD card lifespan.

like image 555
plus- Avatar asked Feb 18 '23 19:02

plus-


1 Answers

Redirect logging to /dev/null instead of a file:

mongod --fork --logpath /dev/null
like image 134
JohnnyHK Avatar answered Feb 21 '23 05:02

JohnnyHK