- Running mongod process
- mongodump
- mongo
- (configured)s3cmd
- tar
- rm
- curl
bash /path/to/backup.sh -u MONGODB_USER -p MONGODB_PASSWORD -o MONGODB_HOST -b S3_BUCKET
Add the following line to /etc/cron.d/db-backup
to run the script every day at midnight (UTC time)
0 0 * * * root /bin/bash /path/to/backup.sh -u MONGODB_USER -p MONGODB_PASSWORD -o MONGODB_HOST -b S3_BUCKET`