I ran into a problem while taking a mongo dump, and I also wanted to save the S3 dump. Finally, I got a bash script to take mongo dump and save it to S3. I used mongodump for backup.
mongodump -h $MONGO_HOST:$MONGO_PORT -d $MONGO_DATABASE
Where $MONGO_HOST , $MONGO_PORT and $MONGO_DATABASE are the bash variables for host , port and database-name respectively. You can also use the --username user --password pass option for the mongodump command if you have a username and password setting in the database. Here is a script to take a mongodb dump and save it to S3 using cron.
Ajeet khan
source share