
Product
Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
s3-mongo-backup
Advanced tools
This Module Helps in automating mongodb database Backups and uploading them to AWS S3.
const MBackup = require('s3-mongo-backup');
var backupConfig = {
mongodb: "mongodb://username:password@localhost:27017", // MongoDB Connection URI
s3: {
accessKey: "", //AccessKey
secretKey: "", //SecretKey
region: "", //S3 Bucket Region
accessPerm: "private", //S3 Bucket Privacy, Since, You'll be storing Database, Private is HIGHLY Recommended
bucketName: "" //Bucket Name
},
keepLocalBackups: false, //If true, It'll create a folder in project root with database's name and store backups in it and if it's false, It'll use temporary directory of OS
noOfLocalBackups: 5, //This will only keep the most recent 5 backups and delete all older backups from local backup directory
timezoneOffset: 300 //Timezone, It is assumed to be in hours if less than 16 and in minutes otherwise
}
Or
var backupConfig = {
mongodb: {
"database": "freecodecamp",
"host": "localhost",
"username": "admin",
"password": "password",
"port": 27017
},
s3: {
accessKey: "", //AccessKey
secretKey: "", //SecretKey
region: "", //S3 Bucket Region
accessPerm: "private", //S3 Bucket Privacy, Since, You'll be storing Database, Private is HIGHLY Recommended
bucketName: "" //Bucket Name
},
keepLocalBackups: false, //If true, It'll create a folder in project root with database's name and store backups in it and if it's false, It'll use temporary directory of OS
noOfLocalBackups: 5, //This will only keep the most recent 5 backups and delete all older backups from local backup directory
timezoneOffset: 300 //Timezone, It is assumed to be in hours if less than 16 and in minutes otherwise
}
MBackup(backupConfig)
.then(
onResolve => {
// When everything was successful
console.log(onResolve);
}
onReject => {
// When Anything goes wrong!
console.log(onReject);
});
See examples directory for more examples
Database zip files are stored in format {database_name}_{YYYY-MM-DDTHH:mm:ss}
. Here, If you don't provide a Timezone offset, It'll assume UTC timezone and name all the backups accordingly. Now, If something goes wrong at "2:00 PM" in your timezone and you need to restore a backup made at "1:00 PM" in your timezone, You'll have to change UTC time to your time and then see which backup you have to restore.
But If you provide a timezone of where ever you live, You can immdiately recognise which backup can be useful.
To see how to provide Timezone offset, Please refer to moment#utcOffset
MIT
2.0.0 -> Uses MongoDB Connection URI directly, instead of asking for individual values of username, database name, password and database host.
This module uses mongodump
to create backup of database, You need to have it installed on the machine on which you are using this module.
To restore the generated backups
mongorestore --host localhost --port=27017 --gzip --archive=<path to backup.gz>
FAQs
Backup and Upload MongoDB Databases to S3
The npm package s3-mongo-backup receives a total of 111 weekly downloads. As such, s3-mongo-backup popularity was classified as not popular.
We found that s3-mongo-backup demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.