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
# Use environment variable as password (could also be a password stored in a file, read with cat) | |
# DO NOT use --password argument in mongodump command or authentication will fail | |
# DO NOT add a file name after --archive argument, or mongodump output won't be sent to stdout | |
# Use S3 infrequent access storage class to reduce cost | |
# Use aes-256 encryption of your file on S3 (or your own KMS keys) | |
# Benefits of this method : | |
# 1 > You won't see the password sent to mongodump using in ps command (it's safe in a multi-user environment) | |
# 2 > You don't have to store the backup locally before sending it to S3 | |
# 3 > Everything is done in one line, fits a cronjob easily |
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
var express = require('express') | |
var app = express() | |
var AWS = require('aws-sdk'); | |
var bodyParser = require('body-parser'); | |
var fs = require('fs'); | |
var zlib = require('zlib'); // gzip compression | |
var multiparty = require('connect-multiparty'), | |
multipartyMiddleware = multiparty(); |