GithubHelp home page GithubHelp logo

happyfoxinc / node-mongodb-s3-backup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from theycallmeswift/node-mongodb-s3-backup

0.0 5.0 0.0 235 KB

A node.js package that makes syncing a MongoDB database to S3 simple.

JavaScript 100.00%

node-mongodb-s3-backup's Introduction

Node MongoDB / S3 Backup

This is a package that makes backing up your mongo databases to S3 simple. The binary file is a node cronjob that runs at midnight every day and backs up the database specified in the config file.

Installation

npm install mongodb_s3_backup -g

Configuration

To configure the backup, you need to pass the binary a JSON configuration file. There is a sample configuration file supplied in the package (config.sample.json). The file should have the following format:

{
  "mongodb": {
    "host": "localhost",
    "port": 27017,
    "username": false,
    "password": false,
    "db": "database_to_backup"
  },
  "s3": {
    "key": "your_s3_key",
    "secret": "your_s3_secret",
    "bucket": "s3_bucket_to_upload_to",
    "destination": "/",
    "encrypt": true,
    "region": "s3_region_to_use"
  },
  "cron": {
    "time": "11:59",
  }
}

All options in the "s3" object, except for desination, will be directly passed to knox, therefore, you can include any of the options listed in the knox documentation.

Crontabs

You may optionally substitute the cron "time" field with an explicit "crontab" of the standard format 0 0 * * *.

  "cron": {
    "crontab": "0 0 * * *"
  }

Note: The version of cron that we run supports a sixth digit (which is in seconds) if you need it.

Timezones

The optional "timezone" allows you to specify timezone-relative time regardless of local timezone on the host machine.

  "cron": {
    "time": "00:00",
    "timezone": "America/New_York"
  }

You must first npm install time to use "timezone" specification.

Running

To start a long-running process with scheduled cron job:

mongodb_s3_backup <path to config file>

To execute a backup immediately and exit:

mongodb_s3_backup -n <path to config file>

node-mongodb-s3-backup's People

Contributors

theycallmeswift avatar joegoldbeck avatar riggsd avatar max-b avatar

Watchers

 avatar James Cloos avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.