Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chrisantonellis/mongobar
mongobar 🍫 MongoDB Backup and Restore manager
https://github.com/chrisantonellis/mongobar
mongodb mongodb-backup mongodump mongorestore
Last synced: 3 months ago
JSON representation
mongobar 🍫 MongoDB Backup and Restore manager
- Host: GitHub
- URL: https://github.com/chrisantonellis/mongobar
- Owner: chrisantonellis
- License: mit
- Created: 2017-09-01T15:38:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-24T14:25:37.000Z (over 6 years ago)
- Last Synced: 2024-09-15T04:07:09.995Z (4 months ago)
- Topics: mongodb, mongodb-backup, mongodump, mongorestore
- Language: Python
- Homepage:
- Size: 1.62 MB
- Stars: 45
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## mongobar [![Build Status](https://travis-ci.org/chrisantonellis/mongobar.svg?branch=master)](https://travis-ci.org/chrisantonellis/mongobar) [![Coverage Status](https://coveralls.io/repos/github/chrisantonellis/mongobar/badge.svg?branch=master)](https://coveralls.io/github/chrisantonellis/mongobar?branch=master)
![](assets/backups.png)
mongobar is a python shell script used to create and manage MongoDB backups. Internally it is a wrapper for the MongoDB **mongodump** and **mongorestore** commands.## Installation
```
pip install mongobar
```
## Usage
Run `mongobar` in a terminal## Help
Access help via the `-h --help` commands. All actions have associated help text.`mongobar --help`
![mongobar --help](assets/help.png)
`mongobar backup --help`
![mongobar --help](assets/help_backup.png)## Configuration
mongobar comes with a default configuration that defines a `Connection` for a MongoDB server running on **localhost:27017** with authentication disabled. Here is what that config looks like:
```json
{
"root": "~/.mongobar_backups",
"log_level": "INFO",
"connections": {
"default": {
"host": "localhost",
"port": 27017
}
}
}
```
The `default` connection can be overridden and additional connections can be added by writing a config file. Here is an example of a custom config:
```json
{
"connections": {
"default": {
"host": "localhost",
"port": 27017,
"username": "user",
"password": "pass",
"authdb": "admin"
},
"production": {
"host": "102.100.204.35",
"port": 27017,
"username": "user",
"password": "pass",
"authdb": "admin"
}
}
}
```
mongobar will try to load a config file from `~/.mongobar_config.json` by default. This path can be changed by using the `--config` flag. The current configuration can be viewed by running the `config` action.## Connections
mongobar uses the `connection` action to view and set the **current connection**. This attribute is used by actions `backup`, `restore`, `remove`, `backups`, `hosts`, and `meta`. Connections are defined in the configuration file and can be viewed by running the `config` action.