Skip to content

Instantly share code, notes, and snippets.

View fmnxl's full-sized avatar

Freeman fmnxl

View GitHub Profile
@fmnxl
fmnxl / a_mongodb_to_s3_backup.sh
Created January 25, 2017 14:50 — forked from lazarofl/a_mongodb_to_s3_backup.sh
MongoDB Automatic Backup to Amazon S3 with Crontab and s3cmd. Red Hat Linux on Amazon EC2
#!/bin/bash
#Force file syncronization and lock writes
mongo admin --eval "printjson(db.fsyncLock())"
MONGODUMP_PATH="/usr/bin/mongodump"
MONGO_HOST="prod.example.com"
MONGO_PORT="27017"
MONGO_DATABASE="dbname"