Skip to content

Lightweight shell script that performs automated MongoDB Backups with Email Notifications

Notifications You must be signed in to change notification settings

ahsantahseen/MongoBackup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Mongo Backup Script

A Lightweight shell script designed to automate the backup process of MongoDB databases and send the backup files via email. This script ensures that your database backups are created securely and efficiently, with an easy-to-follow setup and execution process.

Mongo-Backup-Service

Features

  • Automated Backups: Schedule backups to run automatically at specified intervals using cron jobs.
  • Compression: Creates a compressed ZIP file of the backup directory with optional password protection.
  • Email Notifications: Sends the backup file as an email attachment to a specified email address.
  • Customizable Settings: Easily configure MongoDB connection details, email SMTP settings, and backup directory paths.
  • Log Generation: Generates logs of the backup operation for easy monitoring and troubleshooting.

Pre-Requists

Make sure to:

  • Name this file mongobackup.sh and place it in /home/$userdir
  • Run sudo apt-get install sendemail to install the sendemail for sending the backup file through email
  • Fill in DB host, name, port number, user and password
  • Run chmod +x mongobackup.sh
  • Test it out via ./mongobackup.sh
  • Set up a monthly backup via crontab -e: ? 0 0 1 * * /home/ubuntu/mongobackup.sh > /home/ubuntu/backup.log

About

Lightweight shell script that performs automated MongoDB Backups with Email Notifications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages