New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

aws-mongodump

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-mongodump

mongodumps directly to s3, does not pass go, does not create dump locally and then upload. streams and pipes all the way.

latest
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

aws-mongodump

A node.js package to dump mongodb (mongodump) directly into s3 without filling up your local disk in the process.

NOTE: This is still a work in progress. Please don't rely on it as your only backup option, especially without some decent testing.

NOTE 2: You may need to upgrade your version of mongodump (by upgrading mongo) due to this issue: https://jira.mongodb.org/browse/SERVER-5233

Install

npm install aws-mongodump

Use

var dump = require('aws-mongodump').dump;

var now = +new Date(); // gives the current time as a number

dump("MY_MONGO_URI", "mongobackup-" + now, function (err, res) {
  if (err) { throw err; }
  console.log('results: ', res);
});

By default, dumpstr will check for a file in your working directory called "conf.js", which should look something like this.

// This file is called conf.js
module.exports = {
  aws: {
    key: "MY_KEY_IS_HERE"
  , secret: "THIS_IS_SECRET_HERE"
  , bucket: "I_HAS_A_BUCKET"
  }
}

You can also update that path using setConfig.

var md = require('dumpstr')
, dump = md.dump;

md.setConfig("my_config_path/is_better.js");

Or you can supply a json config object directly using setConfigJson.

var md = require('dumpstr')
, dump = md.dump;

md.setConfigJson(json);

If you want to keep your configs in environment variables instead (Who could blame you?), go ahead and set these instead. That way you can leave out the config file entirely.

AWS_KEY
AWS_SECRET
AWS_BUCKET

Thanks

@timisbusy for the providing pretty much all of this code base, added convict (json) config options and updated logger.

Keywords

aws

FAQs

Package last updated on 12 Dec 2014

Did you know?

Socket

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.

Install

Related posts