This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Backup a mongodb database and send the resulting backup archive (tar.gz) to an S3 bucket. | |
# | |
# Prerequisites: | |
# mongodump | |
# s3cmd | |
# | |
# Use in crontab, e.g. for nightly backups (at 02:25): | |
# 25 2 * * * /usr/local/bin/mongo-backup -c /usr/local/etc/mongo-backup.conf >> /var/log/mongo-backup.log 2>&1 |