Mongo Scripting the shell

Posted by cKendrick on Server Fault See other posts from Server Fault or by cKendrick
Published on 2012-11-03T21:52:29Z Indexed on 2012/11/03 23:04 UTC
Read the original article Hit count: 210

Filed under:
|

On my production stack, I have a front-end server and a Mongo server. I would like to be able to set a cron job on the front-end server to create some logs daily.

I wrote a script that does this:

./mongo server:27017/dbname --quiet my_commands.js

If I run it from the Mongo server as above, it works fine. However, I would like to be able to run it from the front-end server. When I try to do that, I get:

-bash: mongo: command not found

Since mongo is not installed on the front end server, it gives me that error.

Is it possible to somehow bind mongo to my mongo on the Mongo server?

© Server Fault or respective owner

Related posts about centos

Related posts about mongodb