{ "info": { "author": "Alejandro Ricoveri", "author_email": "alejandroricoveri@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Database" ], "description": "m2bk\n====\n.. image:: https://travis-ci.org/axltxl/m2bk.svg?branch=develop\n :target: https://travis-ci.org/axltxl/m2bk\n.. image:: https://badge.fury.io/py/m2bk.svg\n :target: http://badge.fury.io/py/m2bk\n.. image:: https://img.shields.io/gratipay/axltxl.svg\n :target: https://gratipay.com/axltxl\n\nSend your mongodump backups straight to AWS S3\n----------------------------------------------\n\n*m2bk* is command line tool that performs a number of\n**mongodb database backups via mongodump**, compresses them into a\ngzipped tarball and finally sends them to an **AWS S3 bucket**\n(more options are about to be available).\n\n.. image:: http://i.imgur.com/PxqbEPA.gif\n\n- `Requirements <#requirements>`_\n- `Contributing <#contributing>`_\n- `Installation <#installation>`_\n- `Basic usage <#basic-usage>`_\n- `Options <#options>`_\n- `Configuration file <#configuration-file>`_\n\n - `Sections and directives <#configuration-file-sections-and-directives>`_\n\n - `fs section <#fs-section>`_\n - `mongodb section <#mongodb-section>`_\n\n - `mongodb.host_defaults section <#mongodbhost_defaults-section>`_\n - `mongodb.hosts section <#mongodbhosts-section>`_\n\n - `Drivers (driver section) <#drivers-driver-section>`_\n\n - `dummy <#dummy>`_\n - `s3 <#s3>`_\n\n- `Donating <#donating>`_\n- `Copyright and licensing <#copyright-and-licensing>`_\n\nRequirements\n============\n\n- `python `_ >= 3.3\n- `boto `_ >= 2.33\n- `envoy `_ >= 0.0.3\n- `pyyaml `_ >= 3.11\n- `mongodb `_ >= 2.4\n- `clint `_ >= 0.4.1\n\n\nContributing\n============\n\nThere are many ways in which you can contribute to m2bk.\nCode patches are just one thing amongst others that you can submit to help the project.\nWe also welcome feedback, bug reports, feature requests, documentation improvements,\nadvertisement and testing.\n\nFeedback contributions\n----------------------\n\nThis is by far the easiest way to contribute something.\nIf you\u2019re using m2bk for your own benefit, don\u2019t hesitate sharing.\nFeel free to `submit issues and enhancement requests. `_\n\nCode contributions\n------------------\n\nCode contributions (patches, new features) are the most obvious way to help with the project\u2019s development.\nSince this is so common we ask you to follow our workflow to most efficiently work with us.\nFor code contributions, we follow the \"fork-and-pull\" Git workflow.\n\n\n1. Fork, then clone your repo on GitHub\n::\n\n git clone git@github.com:your-username/m2bk.git\n git add origin upstream https://github.com/axltxl/m2bk.git\n\nIf you already forked the repo, then be sure to merge\nthe most recent changes from \"upstream\" before making a pull request.\n::\n\n git pull upstream\n\n2. Create a new feature branch in your local repo\n::\n\n git checkout -b my_feature_branch\n\n3. Make your changes, then make sure the tests passes\n::\n\n pyvenv m2bk-pyve && source m2bk-pyve/bin/activate\n python3 setup.py test\n\n4. Commit your changes once done\n::\n\n git commit -a -m \"My commit message\"\n git push origin my_feature_branch\n\n5. Submit a `pull request `_ with your feature branch containing your changes.\n\nInstallation\n============\n\nInstallation of m2bk can be made directly from source, via `pip `_ or\n`easy_install `_, whichever you prefer.\n\nOption # 1: pip\n---------------\n::\n\n $ pip install m2bk\n\nOption # 2: from source\n-----------------------\n::\n\n $ git clone git@github.com:axltxl/m2bk.git\n $ cd m2bk\n $ python3 setup.py install\n\nOption # 3: easy_install\n------------------------\n::\n\n $ easy_install m2bk\n\nFrom this point you can edit your `configuration file <#configuration-file>`_\n::\n\n $ vi /etc/m2bk/m2bk.yaml\n\nBasic Usage\n===========\nNormal execution\n::\n\n $ m2bk\n\nQuiet output\n::\n\n $ m2bk -q\n\nDry run\n::\n\n $ m2bk -d\n\nSpecify an alternate configuration file\n::\n\n $ m2bk -c /path/to/my/custom/m2bk.yaml\n\n\nOptions\n=======\n::\n\n m2bk [options]\n\n\n- ``--version`` show version number and exit\n- ``-h | --help`` show a help message and exit\n- ``-c [file] | --config=[file] | --config [file]`` specify configuration file to use\n- ``-d | --dry-run`` don't actually do anything\n- ``-q | --quiet`` quiet output\n- ``--ll | --log-level=[num]`` set logging output level\n- ``-l LOG_FILE | --log-file LOG_FILE set log file``\n\nConfiguration file\n------------------\n\nThe configuration is handled through a simple `YAML `_\nfile including a series of *sections* (which are YAML objects), each one\ncomposed by *directives* (YAML numbers, strings or arrays), these will\ndetermine a corresponding behavior on **m2bk**. If **m2bk** does not receive\nany configuration file on command line, it will try to read ``/etc/m2bk.yaml``.\n**Please note the configuration format is still a work in progress and will most likely change in the early stages of m2bk.**\n\n\nThe following is an example of what a configuration file looks like:\n\n::\n\n ---\n driver:\n name: s3\n options:\n aws_access_key_id: \"SDF73HSDF3663KSKDJ\"\n aws_secret_access_key: \"d577273ff885c3f84dadb8578bb41399\"\n fs:\n output_dir: \"/opt/tmp/mydir\"\n mongodb:\n mongodump: \"/opt/bin/mongodump\"\n host_defaults:\n port: 666\n user_name: \"satan\"\n password: \"14mh4x0r\"\n hosts:\n foo:\n address: \"foo.example.local\"\n port: 34127\n dbs:\n - \"app\"\n - \"sessions\"\n - \"another_one\"\n bar:\n address: \"bar.example.com\"\n password: \"1AmAn07h3rh4x0r\"\n auth_db: bar\n dbs:\n - customers\n - sessions\n\nThrough this configuration file, you can set key variables about the\ndatabases you want to backup and the AWS S3 bucket you wish to send them\nto.\n\nConfiguration file: sections and directives\n-------------------------------------------\n\n``fs`` section\n^^^^^^^^^^^^^^\n\nThis section has directives regarding files and directories manipulation\n\nDirectives\n^^^^^^^^^^\n\n``fs.output_dir``\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n- Type: **string**\n- Default value : ``/tmp/m2bk``\n- Role: directory where m2bk is going to temporarily save backup files\n\n\n``mongodb`` section\n^^^^^^^^^^^^^^^^^^^\n\nThis section holds directives regarding mongodb servers **m2bk** is going\nto connect to, including databases that are going to be backed up through *mongodump*.\n\n**Example**:\n::\n\n mongodb:\n mongodump: \"/opt/bin/mongodump\"\n host_defaults:\n user_name: tom\n address: db.example.local\n password: \"457893mnfs3j\"\n dbs:\n - halloran\n - grady\n hosts:\n foo:\n address: db0.example.internal\n port: 27654\n user_name: matt\n password: \"myS3cr37P455w0rd\"\n dbs:\n # This list is going to be merged with dbs at host_defaults, thus\n # the resulting dbs will be:\n # ['halloran', 'grady', 'jack', 'wendy', 'danny']\n - jack\n - wendy\n - danny\n bar: {} # This one is going to acquire all host_defaults values\n host_with_mixed_values:\n # This host will inherit port, password and dbs from host_defaults\n address: moloko.example.internal\n user_name: alex\n address: localhost\n auth_db: milk_plus\n\n\nDirectives\n^^^^^^^^^^\n\n``mongodb.mongodump``\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n- Type: **string**\n- Default value : ``mongodump``\n- Role: full path to the ``mongodump`` executable used by m2bk\n\n``mongodb.host_defaults`` section\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nMany directives (such as user name and/or password) could be common\namong the databases that are going to be backed up. For this reason, it\nis best to simply put those common directives under a single section,\nthis is entirely optional but also it is the best for easily manageable\nconfiguration files in order to avoid redundancy, the supported\ndirectives are ``user_name``, ``password``, ``port``, ``dbs`` and ``auth_db`` .\nSee ``hosts`` section.\n\n``mongodb.hosts`` section\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThis is an object/hash, where each element contains a series of\ndirectives relative to a mongodb database located at a server, its\nspecifications and databases themselves held by it, these are\nthe main values used by ``mongodump`` when it does its magic. For each\nentry inside the ``hosts`` section, these are its valid directives:\n\n\nDirectives\n^^^^^^^^^^\n\n``mongodb.hosts.*.address``\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n- Type: **string**\n- Required: YES\n- Role: mongodb server location\n\n``mongodb.hosts.*.port``\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n- Type: **integer**\n- Required: NO\n- Default value : ``mongo.host_defaults.port | 27017``\n- Role: mongodb server listening port\n\n``mongodb.hosts.*.user_name``\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n- Type: **string**\n- Required: NO\n- Default value : ``mongodb.host_defaults.user_name | m2bk``\n- Role: user name used for authentication against the mongodb server\n\n``mongodb.hosts.*.password``\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n- Type: **string**\n- Required: NO\n- Default value : ``mongodb.host_defaults.pass | \"pass\"``\n- Role: password used for authentication against the mongodb server\n\n``mongodb.hosts.*.auth_db``\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n- Type: **string**\n- Required: NO\n- Default value : ``admin``\n- Role: authentication database\n\n``mongodb.hosts.*.dbs``\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n- Type: **array**\n- Required: NO\n- Default value : ``mongodb.host_defaults.dbs | []``\n- Role: a list of databases who are expected inside the mongodb server\n\n**NOTE: particular \"dbs\" on one host will be merged with those of \"host_defaults\"**\n\nDrivers (``driver`` section)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nOnce backup files have been generated, they are then handled by a driver, whose\njob is to transfer resulting backup files to some form of storage (depending\non the driver set on configuration). Drivers (and their options) are\nset and configured inside the ``driver`` section like so:\n\n::\n\n driver:\n # First of all, you need to tell m2bk which driver to use\n name: dummy\n\n # Inside this key, driver options are set\n options:\n hello: world\n another_option: another_value\n\nPer driver, there are a bunch of available ``options`` to tweak them.\nThese options vary among drivers. Though there is only one driver available on\nm2bk, there will be more drivers available with new releases. Current available\ndrivers are the following:\n\n``dummy``\n^^^^^^^^^\n\nThis driver is just a placeholder for testing out the driver interface as\nit won't do a thing on backup files.\n\nOptions\n^^^^^^^\n\nThere are no options for this driver. Any option passed to this driver\nwill be logged at debug level.\n\n``s3``\n^^^^^^\n\nThis driver holds directives regarding AWS credentials that **m2bk**\nis going to use in order to upload the *mongodump* backups to S3.\nIf either ``aws_access_key_id`` or ``aws_secret_access_key`` are not specified,\nthis driver will not try to use them to authenticate against AWS and will rely\non `boto config `_ for that matter.\n\n**Example**:\n::\n\n driver:\n name: s3\n options:\n aws_access_key_id\": \"HAS6NBASD8787SD\"\n aws_secret_access_key: \"d41d8cd98f00b204e9800998ecf8427e\"\n s3_bucket: \"mybucket\"\n\nOptions\n^^^^^^^\n\n``aws_access_key_id``\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n- Type: **string**\n- Required: NO\n- Role: AWS access key ID\n\n\n``aws_secret_access_key``\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n- Type: **string**\n- Required: NO\n- Role: AWS access key ID\n\n``s3_bucket``\n\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n- Type: **string**\n- Required: NO\n- Default value: ``m2bk``\n- Role: name of the main S3 bucket where m2bk is going to upload the compressed backups for each mongodb server specified in ``mongodb`` section\n\nDonating\n========\n\nShow your love and support this project via `gratipay `_\n\n.. image:: https://cdn.rawgit.com/gratipay/gratipay-badge/2.3.0/dist/gratipay.png\n :target: https://gratipay.com/axltxl\n\nCopyright and Licensing\n=======================\n\nCopyright (c) Alejandro Ricoveri\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/axltxl/m2bk/tarball/0.4.0", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/axltxl/m2bk", "keywords": "mongodb,aws,backup,s3", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "m2bk", "package_url": "https://pypi.org/project/m2bk/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/m2bk/", "project_urls": { "Download": "https://github.com/axltxl/m2bk/tarball/0.4.0", "Homepage": "https://github.com/axltxl/m2bk" }, "release_url": "https://pypi.org/project/m2bk/0.4.0/", "requires_dist": null, "requires_python": null, "summary": "A command line tool to orchestrate MongoDB backups", "version": "0.4.0" }, "last_serial": 1665692, "releases": { "0.3.0": [ { "comment_text": "", "digests": { "md5": "a456c8889c9065f553843af531386950", "sha256": "be16b62bef4559fab6dee0c7c7108594b794f42182626c18a7cf112eaa227cd2" }, "downloads": -1, "filename": "m2bk-0.3.0.tar.gz", "has_sig": false, "md5_digest": "a456c8889c9065f553843af531386950", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23948, "upload_time": "2015-02-28T13:13:18", "url": "https://files.pythonhosted.org/packages/30/93/6a232d41fb1b4079dbfe1ec28ddb5054cfcb40f6ed82a29a9f83fb583cdd/m2bk-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "0e23afd5a9b321065b50ab01e47e6bb8", "sha256": "acab85161b06069bd95073f2643124243cc236b33641f5897e6f8988254ea13d" }, "downloads": -1, "filename": "m2bk-0.3.1.tar.gz", "has_sig": false, "md5_digest": "0e23afd5a9b321065b50ab01e47e6bb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25096, "upload_time": "2015-02-28T15:56:03", "url": "https://files.pythonhosted.org/packages/d9/f3/9faca416a5bff7c518246440ab73016cdb5d6c0df386a205db0295d1f0d8/m2bk-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "087430c2c2fad85e84fb763a85e431f1", "sha256": "992d8f9c3f4f6913e1cb55b9891c8b3fd567c1a7653e54028f422349575704d1" }, "downloads": -1, "filename": "m2bk-0.4.0.tar.gz", "has_sig": false, "md5_digest": "087430c2c2fad85e84fb763a85e431f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31487, "upload_time": "2015-08-04T14:07:35", "url": "https://files.pythonhosted.org/packages/fe/ab/1a0b5abaf14df57ff5bcbb959fa40d7eb5261901463d7d7df8ddde86dadf/m2bk-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "087430c2c2fad85e84fb763a85e431f1", "sha256": "992d8f9c3f4f6913e1cb55b9891c8b3fd567c1a7653e54028f422349575704d1" }, "downloads": -1, "filename": "m2bk-0.4.0.tar.gz", "has_sig": false, "md5_digest": "087430c2c2fad85e84fb763a85e431f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31487, "upload_time": "2015-08-04T14:07:35", "url": "https://files.pythonhosted.org/packages/fe/ab/1a0b5abaf14df57ff5bcbb959fa40d7eb5261901463d7d7df8ddde86dadf/m2bk-0.4.0.tar.gz" } ] }