Skip to content

Instantly share code, notes, and snippets.

View pariz's full-sized avatar

Pär Karlsson pariz

View GitHub Profile
@simonnordberg
simonnordberg / mongo-backup
Last active February 27, 2016 15:39
Backup a mongodb database and send the resulting backup archive (tar.gz) to an S3 bucket
#!/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