Posts

Showing posts with the label Mailx

Featured Post

How to Build CI/CD Pipeline: GitHub to AWS

Image
 Creating a CI/CD pipeline to deploy a project from GitHub to AWS can be done using various AWS services like AWS CodePipeline, AWS CodeBuild, and optionally AWS CodeDeploy or Amazon ECS for application deployment. Below is a high-level guide on how to set up a basic GitHub to AWS pipeline: Prerequisites AWS Account : Ensure access to the AWS account with the necessary permissions. GitHub Repository : Have your application code hosted on GitHub. IAM Roles : Create necessary IAM roles with permissions to interact with AWS services (e.g., CodePipeline, CodeBuild, S3, ECS, etc.). AWS CLI : Install and configure the AWS CLI for easier management of services. Step 1: Create an S3 Bucket for Artifacts AWS CodePipeline requires an S3 bucket to store artifacts (builds, deployments, etc.). Go to the S3 service in the AWS Management Console. Create a new bucket, ensuring it has a unique name. Note the bucket name for later use. Step 2: Set Up AWS CodeBuild CodeBuild will handle the build proces

How to Send Shell script Result to Email

Image
The shell-script result you can send to email. Below, you will find the steps you need to do it. There are two steps and both will help you know the entire process. Sending shell-script results to email Creating shell-script Sending the result to email 1. Creating shell-script Create an empty script Create test1.sh script using the vi command with the Sudo command. $sudo vi test1.sh Write the first line in the script #!/bin/bash exec > out1.txt 2>&1 Add logic in the shell script #!/bin/bash exec > out1.txt 2>&1 echo" Here is my logic" Provide executable permissions to your script $ sudo chmod +x test1.sh Run your script using the command below $ ./test1.sh Verify the output $ cat out1.txt 2. Sending result to email Use the below command to send the output (result) to email. $ mail <<output file path name>> abc@gmail.com Bottom-line These steps are helpful to send the output to an email.  References How to Install Mailx Utility in Linux