Skip to content

Instantly share code, notes, and snippets.

View HADMARINE's full-sized avatar
🚩
Accepting chances

Hojoon LEE HADMARINE

🚩
Accepting chances
View GitHub Profile
@H-Max
H-Max / mongodb-backup.sh
Last active October 23, 2023 17:21
Backup mongodb database directly to S3
# 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
@joshbedo
joshbedo / s3multipart.js
Created August 13, 2015 11:57
S3 multipart upload with NodeJS
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();