Skip to content
Tiny concurrent and scheduled dump creator for MongoDB.
Go
Branch: master
Clone or download
Latest commit d851c95 Jul 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
mgosd
.gitignore Updated Readme; removed entire license text from source files. Jun 23, 2019
LICENSE Initial commit Jun 22, 2019
README.md Update README.md Jul 17, 2019
main.go Updated Readme; removed entire license text from source files. Jun 23, 2019

README.md

Table of Contents

  1. About
  2. Features
  3. Installation
  4. Usage
  5. Roadmap

mgosd

Tiny concurrent and scheduled dump creator for MongoDB.

Why not using something like cron? So, cron is awesome Unix tool, but it's available on Unix systems only. mgosd allows you to do not waste your time on dealing with scheduled task systems in different environments.

Current stable version: v1.1.0

Licensed under GNU GPLv3.

Features

  • Concurrent: mgosd process every collection in separate goroutine
  • Scheduled: you can set different intervals of dumping
  • Two ways of configuration: CLI arguments and JSON config file
  • Portable: you don't need to install MongoDB toolkit to use it
  • Cross-platform: unite configuration for all systems

Installation

If you're on Linux you can find binary executable on Releases page.

If you're on Mac or Windows:

  1. Install Go compiler (1.12.6+)
  2. Install mgo dependency by running go get github.com/globalsign/mgo
  3. Compile mgosd by running go build main.go
  4. Done!

Usage

There are two ways of using mgosd:

  1. Configuration via CLI arguments:
$ ./mgosd -h
+----------------------------------------+
| mgosd (c) Ildar Karymov, 2019          |
| https://github.com/ildarkarymoff/mgosd |
| License: GNU GPLv3                     |
| Version: 1.1.0                         |
+----------------------------------------+
Usage of ./mgosd:
  -db string
    	Database name
  -host string
    	Database server address (default "127.0.0.1")
  -i string
    	Interval of dumping (default "12h")
  -login string
    	Database username (default "<empty>")
  -o string
    	Path to output directory (default $HOME)
  -password string
    	Database user password (default "<empty>")
  -port int
    	Database server port (default 27017)
  1. Using JSON configuration:
{
  "collections": [
    "users",
    "comments",
    "posts"
  ],
  "interval": "5s",
  "output": "dumps_test",
  "db": {
    "database": "mydb",
    "host": "localhost",
    "port": 27017
  }
}
$ ./mgosd config.json

Roadmap

  • Streamed reading from MongoDB
  • Switch to official MongoDB driver for Go
  • Ability to configure the schedule in absolute way (implicit time of day)
  • Binary executables for Mac and Windows
You can’t perform that action at this time.