HOW TO WRITE DOCKER CONTAINER STOP ALERT ON EMAIL FROM BASH SCRIPT: DOCKER MONITORING

From this tutorial you can write bash script to get email when your container will be in any other state except running like stop, exited and others.

linuxawspoint_docker_scripts

Assume that we have running containers are

  • Test1
  • Test2
  • Test3
  • Test4
  • Mail server details to send an email and mail template as per your content

Copy the below code in your script file and make changes as per your environment.

vim docker_con.sh

Continue reading

HOW TO TAKE MONGO CLUSTER DATABASE BACKUP IN AWS S3 FROM BASH SCRIPT

This tutorials  show you example to take mongo cluster database backup and also move it into AWS S3 bucket by mongodump command line client-program and restore them with the help of mongorestore command line in Linux.

linux_point mongo db backup in s3 bucket
mongo db backup in s3

mongodump is command-line program used for take dump of mongo cluster ( mongo replica set with primary, secondary and arbiters ) in a single file.

Assume we have three server running
Primary : 10.0.0.1
Secondary: 10.0.0.2
Arbiters: 10.0.0.3

And configure aws-cli

Port: 27017

vim mongo-db-dump-s3.sh (Copy and paste the below lines and change your IP, username, password)

Continue reading