Skip to main content

Automated script generator to backup MongoDB databases to Amazon S3.

Project description

mongo-to-s3

The mongo-to-s3 package provides a convenient way to backup MongoDB databases and upload the backups to Amazon S3 for safekeeping. This utility allows you to automate the backup process and ensure the security and availability of your MongoDB data.

Features

  • Automatically creates backups of MongoDB databases.
  • Compresses backups and stores them securely in Amazon S3.
  • Generates customizable backup scripts based on user inputs.
  • Supports scheduling backup jobs using cron.
  • Provides logging functionality to track backup activity and errors.

Installation

  1. Ensure you have Python 3 installed on your system.

  2. Install the package using pip:

    pip install mongo-to-s3
    

Usage

  1. Open a terminal or command prompt.

  2. Run the mongo-to-s3 command with the required options,

    mongo-to-s3 -dHost <db_host> -dPort <db_port> -dName <db_name> -sName <s3_bucket_name> -sFolder <s3_folder_name> -sRegion <s3_region>
    

    Replace the placeholders (<db_host>, <db_port>, <db_name>, <s3_bucket_name>, <s3_folder_name>, <s3_region>) with the appropriate values for your setup.

  3. You will be prompted to enter the database username, database password, S3 access key, and S3 secret key.

  4. The backup script will be generated and scheduled to run using cronjobs. By default, it will run every 12 hours. You can customize the cron schedule by adding the -cSchedule option followed by the desired schedule.

    mongo-to-s3 -dHost <db_host> -dPort <db_port> -dName <db_name> -sName <s3_bucket_name> -sFolder <s3_folder_name> -sRegion <s3_region> -cSchedule "0 0 * * *"
    

    This example schedules the backup to run daily at midnight.

  5. The generated backup script will be placed in the mongo-to-s3-scripts directory in the user's home directory.

    You can generate backup script for all of your MongoDB databases this way.

Logs

The mongo-to-s3 utility creates log files for each backup operation. The log files contain information about the backup process and any errors that may have occurred. By default, the log files are stored in the mongo-to-s3-logs directory in the user's home directory.

You can check the logs to monitor the backup activity and troubleshoot any issues that may arise. The log file names follow the format: <db_name>_log_<timestamp>.txt.

To view the logs, navigate to the mongo-to-s3-logs directory:

cd ~/mongo-to-s3-logs

Contributing and Feedback

Contributions, bug reports, and feature requests are welcome! If you encounter any issues or have ideas to improve mongo-to-s3, please check the Issue Tracker for existing issues or open a new one.

If you would like to contribute code to the project, you can follow these steps:

  1. Fork the repository on GitHub.
  2. Clone your forked repository to your local machine.
  3. Make changes and test them thoroughly.
  4. Commit your changes and push them to your forked repository.
  5. Submit a pull request to the main repository.

Your contributions are highly appreciated, whether it's fixing a bug, adding a new feature, or improving documentation.

Additionally, I encourage you to provide feedback and suggestions for the project. You can open an issue to share your thoughts, ideas, or any questions you may have.

Let's make mongo-to-s3 even better together!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mongo_to_s3-0.0.9.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

mongo_to_s3-0.0.9-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file mongo_to_s3-0.0.9.tar.gz.

File metadata

  • Download URL: mongo_to_s3-0.0.9.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for mongo_to_s3-0.0.9.tar.gz
Algorithm Hash digest
SHA256 3d09115491ed3e7a18d36faeb7712dda2d1ad5e673c18f99a90bf4de460a7a30
MD5 12ad16665e99272d9330fa9beb89bbe7
BLAKE2b-256 61599e4ecdbdf998894100a9dc4476bf728f9a6f84dbdd4dd14284ca59808194

See more details on using hashes here.

File details

Details for the file mongo_to_s3-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: mongo_to_s3-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for mongo_to_s3-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 ada39aae807a3fb036ea992b998bdd57cb2a78fb08137f18f37a0c04b173c15d
MD5 3be67a7a0e1828165e8d9fa98bc63ed9
BLAKE2b-256 e096a02890aec8ca39fe7f7bcb78d30a0b52c77e97f33b8bcbd06a92ac8d2a0f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page