I have created this sh script
#!/bin/sh
DIR=`date +%d%m%Y`
DEST=/home/user/backup/$DIR
mkdir $DEST
mongodump --host=same --port=same --username=same --password="same" --db=db1 --out=$DEST
mongodump --host=same --port=same --username=same --password="same" --db=db2 --out=$DEST
to take backup all the collections of two dbs on the same server, with same authentication credentials. How can I write a single mongodump command and include both db names so that only one directory is created, and inside there 2 folders with the db names and the collections respectively are created? I have tried to use mongodump with --uri (without db names) but get authentication error..