This script will help you to create multiple backup of your mongodb at different time.
Some use case are you can use this script to run as a cron job,
or you can manually run this script with python manager.py
- mongodb must be installed on your system.
- Python3 must be installed on your system.
Add your configuration in config.json
file.
- LIMIT is maximum number of backup you want to retain.
- BACKUP_DIR is where your backup will be found.
- HISTORY is where logs of removed directory with time can be found.
- DATABASE is name of your database.
- URI must be in this format
mongodb+srv://<username>:<password>@cluster0.bmggr.mongodb.net/<database_name>
, which you can found in your mongo-atlas account.
- Download these files
- change
config.json
with proper configuration according to you mongo database. - Run
python manager.py