#Scheduled MongoDB Backup
####Required
- Boto S3 [pip install boto]
- s3multiput or s3cmd comes with Amazon EC2 [apt-get install s3cmd]
- FileChunkIO [easy_install FileChunkIO]
####Settings
- Add s3 bucketname, key & secret in aws_s3.py
- Specify the script directory in backup.sh
- Create a cron job by crontab -e
- Add the following lines of code to run the script as a cronjob, following will execute at 12 AM everyday
0 0 * * * touch /home/ubuntu/db-backup/mongodb-auto-backup/backup.sh /dev/null 2>&1
Set the backup time according to your requirement, for more read http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/
####Credits
- http://sunilarora.org/database-backup-from-mongodb-to-amazon-s3-and
- http://www.xorcode.com/2012/08/22/round-robin-mongodb-backups-to-s3-with-tar/
PS: This is bit of a learning bash, license apache 2