MongoDB script to backup replication set locally to a ubuntu 14.04 server I would like to make a Daily Backup of my MongoDB from a replication set running from ubuntu 14.04 server.

End goal would be to get a daily backup and write the backup to a remote or local share - ubuntu.

Can I batch the mongodump command?

Please help me on this
You can execute mongodump from the remote server as mentioned below:

mongodump --host &lt;ip-of-mongodb-server&gt; --port &lt;port-number-of-mongod&gt; --out &lt;some-directory&gt;


This is required mongo server to be accessible from the remote server. 

This dump file can be then compressed and archived on remote host or s3.

If the mongo server is not accessible from remote host, in that case you can execute mongodump on local mongodb server and copy it to remote or local share.