Tool to create MongoDB backups from your MongoDB Atlas database through commandline allowing CRON scheduling.
- Clone the repository to a location of your choosing.
- Make sure the script file is executable (
chmod +x /path/to/script
) - Create a symlink in a folder included in your PATH (e.g. bin) for easing running of the script:
ln -s <PATH_TO_SCRIPT> /home/$USER/bin/mongobackup
- Copy the
example_config
to a file calledconfig
(keeping it in the same folder with the script) and edit your MongoDB Atlas details in. Be careful not to commit your private details to any repository.
mongodump
from mongodb-database-tools- A
config
file as detailed above.
To see all the available options, run the script in terminal with the mongobackup help
argument to see options.
Basic usage:
- After setting up your
config
file, you can just runmongobackup create
to have the tool create a DB dump in $USER/MONGODB_DUMP. - To see available commands, run
mongobackup help
.