<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Saichandu_Devops on Medium]]></title>
        <description><![CDATA[Stories by Saichandu_Devops on Medium]]></description>
        <link>https://medium.com/@saluvalasaichand?source=rss-b48b294e50c8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*X4eOfZltMp_OVtGEvSVtmg.png</url>
            <title>Stories by Saichandu_Devops on Medium</title>
            <link>https://medium.com/@saluvalasaichand?source=rss-b48b294e50c8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 08:56:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saluvalasaichand/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Docker for DevOps Engineers: My Complete Learning Journey (Days 29–37 of #90DaysOfDevOps)]]></title>
            <link>https://medium.com/@saluvalasaichand/docker-for-devops-engineers-my-complete-learning-journey-days-29-37-of-90daysofdevops-684bedee1476?source=rss-b48b294e50c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/684bedee1476</guid>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Saichandu_Devops]]></dc:creator>
            <pubDate>Thu, 04 Jun 2026 05:03:52 GMT</pubDate>
            <atom:updated>2026-06-04T05:03:52.263Z</atom:updated>
            <content:encoded><![CDATA[<p>Docker is one of the most important technologies in modern DevOps. Whether you’re building CI/CD pipelines, deploying applications to Kubernetes, or managing microservices, Docker is everywhere.</p><p>As part of my #90DaysOfDevOps challenge, I spent nine days learning Docker from the ground up. This article summarizes everything I learned — from running my first container to Dockerizing a complete application.</p><h3>Why Docker?</h3><p>Before Docker, developers often faced the famous problem:</p><blockquote><em>“It works on my machine.”</em></blockquote><p>Applications behaved differently across environments because of differences in operating systems, libraries, and dependencies.</p><p>Docker solves this problem by packaging applications and all their dependencies into lightweight, portable containers.</p><p>Benefits of Docker:</p><ul><li>Consistent environments</li><li>Faster deployments</li><li>Better resource utilization</li><li>Easy scalability</li><li>Simplified CI/CD integration</li></ul><h3>Day 29 — Introduction to Docker</h3><p>The first step was understanding Docker fundamentals.</p><h3>Container vs Virtual Machine</h3><h3>Virtual Machines</h3><ul><li>Include a full operating system</li><li>Larger in size</li><li>Slower startup times</li><li>Higher resource consumption</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Dp183pWrGsVJkYMh" /></figure><h3>Containers</h3><ul><li>Share the host OS kernel</li><li>Lightweight</li><li>Faster startup</li><li>Better performance</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jKIM2Bn5zU2xuhjo" /></figure><h3>Docker Architecture</h3><p>Docker consists of:</p><ul><li>Docker Client</li><li>Docker Daemon</li><li>Docker Images</li><li>Docker Containers</li><li>Docker Registry (Docker Hub)</li></ul><h3>My First Container</h3><pre>docker run hello-world</pre><p>This command pulled the image from Docker Hub and started a container successfully.</p><h3>Day 30 — Docker Images &amp; Container Lifecycle</h3><p>Understanding the relationship between images and containers is critical.</p><h3>Docker Image</h3><p>A Docker image is a read-only template used to create containers.</p><p>Examples:</p><pre>docker pull nginx<br>docker pull ubuntu<br>docker pull alpine</pre><h3>Docker Container Lifecycle</h3><pre>Create<br>   ↓<br>Start<br>   ↓<br>Pause<br>   ↓<br>Unpause<br>   ↓<br>Stop<br>   ↓<br>Restart<br>   ↓<br>Remove</pre><p>Key Commands:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/0*vdfOl13qsJQjET9s" /></figure><pre>docker create nginx<br>docker start &lt;container-id&gt;<br>docker stop &lt;container-id&gt;<br>docker rm &lt;container-id&gt;</pre><h3>Docker Layers</h3><p>Docker images are built using layers.</p><p>Benefits:</p><ul><li>Faster builds</li><li>Image caching</li><li>Reduced storage usage</li></ul><p>View image layers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lz03gbsZWdJRA3jk" /></figure><pre>docker image history nginx</pre><h3>Day 31 — Dockerfile: Build Your Own Images</h3><p>A Dockerfile is the blueprint for creating custom Docker images.</p><h3>My First Dockerfile</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Rdy2pBvUimlBvB9b" /></figure><pre>FROM ubuntu</pre><pre>RUN apt update &amp;&amp; apt install curl -y</pre><pre>CMD [&quot;echo&quot;,&quot;Hello from my custom image&quot;]</pre><p>Build image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S44krOgyrwSL_pT4" /></figure><pre>docker build -t my-ubuntu:v1 .</pre><p>Run container:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pLQH8_QJfwUSa77y" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WUYZLwtJccrTOD5x" /></figure><pre>docker run my-ubuntu:v1</pre><h3>Important Dockerfile Instructions</h3><h3>FROM</h3><p>Defines base image.</p><pre>FROM nginx</pre><h3>RUN</h3><p>Executes commands during build.</p><pre>RUN apt update</pre><h3>COPY</h3><p>Copies files into image.</p><pre>COPY . .</pre><h3>WORKDIR</h3><p>Sets working directory.</p><pre>WORKDIR /app</pre><h3>CMD</h3><p>Default command.</p><pre>CMD [&quot;python&quot;,&quot;app.py&quot;]</pre><h3>ENTRYPOINT</h3><p>Defines executable container.</p><h3>Day 32 — Docker Volumes &amp; Networking</h3><p>Containers are ephemeral. When a container is deleted, data is lost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l7JvbIDW4mjiIspt" /></figure><h3>Named Volumes</h3><p>Create volume:</p><pre>docker volume create mysql-data</pre><p>Attach volume:</p><pre>docker run -v mysql-data:/var/lib/mysql mysql</pre><p>Data survives container deletion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*prZY30QCHODHDrwB" /></figure><h3>Bind Mounts</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F5qPlmIl_Z7q1Syx" /></figure><pre>docker run -v $(pwd):/app nginx</pre><p>Changes on the host are reflected inside the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9i59pgdIs8LEXO9j" /></figure><h3>Docker Networks</h3><p>List networks:</p><pre>docker network ls</pre><p>Create custom network:</p><pre>docker network create devops-net</pre><p>Run containers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4qp_G1uS6316xk4I" /></figure><pre>docker run --network devops-net nginx</pre><p>Containers on the same network can communicate using container names.</p><h3>Day 33 — Docker Compose Basics</h3><p>Managing multiple containers manually becomes difficult.</p><p>Docker Compose solves this problem.</p><h3>Simple Compose File</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SDIlUgY7XGTtRLkN" /></figure><pre>version: &quot;3&quot;</pre><pre>services:</pre><pre>  nginx:<br>    image: nginx<br>    ports:<br>      - &quot;80:80&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*90g3bAZF7_sravJc" /></figure><p>Start:</p><pre>docker compose up -d</pre><p>Stop:</p><pre>docker compose down</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LaifQ4fY5_HLavUJ" /></figure><h3>WordPress + MySQL</h3><p>Compose automatically:</p><ul><li>Creates network</li><li>Manages volumes</li><li>Handles service communication</li></ul><h3>Day 34 — Real-World Multi-Container Applications</h3><p>Built a production-like architecture using:</p><ul><li>Flask Application</li><li>MySQL Database</li><li>Redis Cache</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*oea-zHDoAjyXemkZ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f71NLdWGZIXwvMTl" /></figure><h3>Health Checks</h3><pre>healthcheck:<br>  test: [&quot;CMD&quot;,&quot;mysqladmin&quot;,&quot;ping&quot;]</pre><h3>Service Dependency</h3><pre>depends_on:<br>  db:<br>    condition: service_healthy</pre><h3>Restart Policies</h3><pre>restart: always</pre><p>Useful for automatically recovering failed containers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e-1WEPOahNlGzlM5" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x6ppbyCoCfbbE1lc" /></figure><h3>Day 35 — Multi-Stage Builds &amp; Docker Hub</h3><p>One of the most important Docker optimization techniques.</p><h3>Problem</h3><p>Single-stage builds often produce large images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I_aAjfltelVdm0AX" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0N07o-z5zzRctAT-" /></figure><h3>Multi-Stage Build</h3><pre>FROM maven AS builder</pre><pre>WORKDIR /app</pre><pre>COPY . .</pre><pre>RUN mvn package</pre><pre>FROM openjdk:17-jdk-slim</pre><pre>COPY --from=builder target/app.jar app.jar</pre><pre>ENTRYPOINT [&quot;java&quot;,&quot;-jar&quot;,&quot;app.jar&quot;]</pre><p>Benefits:</p><ul><li>Smaller image size</li><li>Improved security</li><li>Faster deployments</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*skdn8s2gdqBk32WX" /></figure><h3>Docker Hub</h3><p>Login:</p><pre>docker login</pre><p>Tag image:</p><pre>docker tag app:v1 saichandu/app:v1</pre><p>Push image:</p><pre>docker push saichandu/app:v1</pre><h3>Day 36 — Dockerize a Full Application</h3><p>This was the most practical day.</p><p>I Dockerized a complete Flask + MySQL application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lfUpAaLR5Pbpa5r6" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oKdI_f2g0SWXx6HO" /></figure><h3>Project Structure</h3><pre>project/</pre><pre>├── app/<br>│   ├── app.py<br>│   ├── requirements.txt<br>│   └── Dockerfile<br>│<br>├── docker-compose.yml<br>└── .env</pre><h3>Application Features</h3><ul><li>Flask backend</li><li>MySQL database</li><li>Persistent storage</li><li>Custom network</li><li>Environment variables</li><li>Health checks</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/0*WgpgsVI77rkNqzdw" /></figure><h3>Docker Compose</h3><pre>services:</pre><pre>  app:<br>    build: ./app</pre><pre>  db:<br>    image: mysql:8</pre><p>Everything could be started with:</p><pre>docker compose up -d</pre><p>This closely resembles real-world application deployments.</p><h3>Day 37 — Docker Revision &amp; Cheat Sheet</h3><p>The final day focused on revision.</p><h3>Topics Revised</h3><ul><li>Docker Commands</li><li>Docker Images</li><li>Containers</li><li>Dockerfile</li><li>Volumes</li><li>Networking</li><li>Docker Compose</li><li>Multi-Stage Builds</li><li>Docker Hub</li><li>Full Application Deployment</li></ul><h3>Frequently Used Commands</h3><h3>Containers</h3><pre>docker ps<br>docker stop<br>docker rm<br>docker exec<br>docker logs</pre><h3>Images</h3><pre>docker build<br>docker pull<br>docker push<br>docker tag</pre><h3>Volumes</h3><pre>docker volume create<br>docker volume ls</pre><h3>Networks</h3><pre>docker network create<br>docker network ls</pre><h3>Compose</h3><pre>docker compose up -d<br>docker compose down<br>docker compose logs</pre><h3>Key Learnings</h3><p>After nine days of hands-on practice, these were my biggest takeaways:</p><h3>Containers are the foundation of modern DevOps</h3><p>Most modern applications run inside containers.</p><h3>Docker Compose simplifies local development</h3><p>Managing multiple services becomes much easier.</p><h3>Multi-stage builds matter</h3><p>Smaller images improve performance and security.</p><h3>Volumes are essential</h3><p>Without volumes, container data is lost.</p><h3>Networking is critical</h3><p>Container-to-container communication powers microservices.</p><h3>Docker skills directly translate to Kubernetes</h3><p>Understanding Docker makes Kubernetes significantly easier to learn.</p><h3>Connect With Me</h3><p>If you’re also learning DevOps, feel free to connect and share your journey.</p><p>Follow me for more content on:</p><ul><li>AWS</li><li>Docker</li><li>Kubernetes</li><li>Jenkins</li><li>Terraform</li><li>DevOps Projects</li></ul><p>#90DaysOfDevOps #Docker #DevOps #CloudComputing #Kubernetes #Jenkins #AWS #Containerization #TrainWithShubham #DevOpsKaJosh</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=684bedee1476" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ End-to-End DevSecOps CI/CD Pipeline for a 3-Tier Java Web Application using Jenkins, Docker…]]></title>
            <link>https://medium.com/@saluvalasaichand/end-to-end-devsecops-ci-cd-pipeline-for-a-3-tier-java-web-application-using-jenkins-docker-9c53f66d9667?source=rss-b48b294e50c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c53f66d9667</guid>
            <dc:creator><![CDATA[Saichandu_Devops]]></dc:creator>
            <pubDate>Sun, 24 May 2026 13:13:55 GMT</pubDate>
            <atom:updated>2026-05-24T13:13:55.304Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 End-to-End DevSecOps CI/CD Pipeline for a 3-Tier Java Web Application using Jenkins, Docker, Nexus, SonarQube &amp; Docker Swarm</h3><p>In this blog, I’ll walk through how I built and deployed a complete <strong>3-Tier Java Web Application</strong> using modern DevOps and DevSecOps practices.</p><p>This project demonstrates a real-world production-style CI/CD workflow involving:<br>✅ Continuous Integration<br>✅ Continuous Delivery<br>✅ Artifact Management<br>✅ Security Scanning<br>✅ Containerization<br>✅ Docker Swarm Deployment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*0ui6AadhrnXwqpw2IdGD5Q.png" /></figure><h3>📌 Project Architecture</h3><p>The application follows a <strong>3-Tier Architecture</strong>:</p><h3>1️⃣ Presentation Layer</h3><ul><li>Frontend UI for user interaction</li></ul><h3>2️⃣ Application Layer</h3><ul><li>Java-based backend application deployed inside Docker containers</li></ul><h3>3️⃣ Database Layer</h3><ul><li>MySQL database container for persistent storage</li></ul><h3>🛠️ Tools &amp; Technologies Used</h3><p>GitHubSource Code ManagementJenkinsCI/CD AutomationMavenBuild &amp; PackagingSonarQubeCode Quality AnalysisNexusArtifact RepositoryDockerContainerizationTrivyVulnerability ScanningDocker HubContainer RegistryDocker SwarmContainer OrchestrationMySQLDatabaseLinuxServer Environment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*tvKiAGiXRwK1kV-5jGl7IQ.png" /></figure><h3>🔁 Complete CI/CD Workflow</h3><p>The entire deployment process was automated through Jenkins Pipeline.</p><h3>🚀 Pipeline Flow</h3><pre>pipeline {<br>    agent {<br>        node {<br>            label &#39;prod&#39;<br>        }<br>    }</pre><pre>    tools {<br>        maven &#39;mymaven&#39;<br>    }</pre><pre>    stages {</pre><pre>        stage(&#39;Git-Checkout&#39;) {<br>            steps {<br>                git branch: &#39;main&#39;,<br>                    url: &#39;https://github.com/saluvalasaichandu/3-Tier-Docker-Application.git&#39;<br>            }<br>        }</pre><pre>        stage(&#39;Code Quality Analysis&#39;) {<br>            steps {<br>                withSonarQubeEnv(&#39;sonarqube&#39;) {<br>                    sh &#39;mvn clean verify sonar:sonar -Dsonar.projectKey=3-Tier-java-app&#39;<br>                }<br>            }<br>        }</pre><pre>        stage(&#39;Build&#39;) {<br>            steps {<br>                sh &#39;mvn clean package&#39;<br>                sh &#39;cp -r target Docker-app&#39;<br>            }<br>        }</pre><pre>        stage(&#39;Artifact-Uploader&#39;) {<br>            steps {<br>                nexusArtifactUploader(<br>                    artifacts: [[<br>                        artifactId: &#39;vprofile&#39;,<br>                        classifier: &#39;&#39;,<br>                        file: &#39;target/vprofile-v2.war&#39;,<br>                        type: &#39;war&#39;<br>                    ]],<br>                    credentialsId: &#39;nexus-creds&#39;,<br>                    groupId: &#39;com.visualpathit&#39;,<br>                    nexusUrl: &#39;3.90.163.133:8081&#39;,<br>                    nexusVersion: &#39;nexus3&#39;,<br>                    protocol: &#39;http&#39;,<br>                    repository: &#39;myrepo&#39;,<br>                    version: &#39;v2&#39;<br>                )<br>            }<br>        }</pre><pre>        stage(&#39;Docker-Image-Build&#39;) {<br>            steps {<br>                sh &#39;docker build -t saichandu27/automation:db Docker-db&#39;<br>                sh &#39;docker build -t saichandu27/automation:app Docker-app&#39;<br>            }<br>        }</pre><pre>        stage(&#39;Trivy-Image-Scan&#39;) {<br>            steps {<br>                sh &#39;trivy image saichandu27/automation:db&#39;<br>                sh &#39;trivy image saichandu27/automation:app&#39;<br>            }<br>        }</pre><pre>        stage(&#39;Docker-Push&#39;) {<br>            steps {<br>                script {<br>                    withDockerRegistry(<br>                        credentialsId: &#39;registry-docker-hub-password&#39;<br>                    ) {<br>                        sh &#39;docker push saichandu27/automation:db&#39;<br>                        sh &#39;docker push saichandu27/automation:app&#39;<br>                    }<br>                }<br>            }<br>        }</pre><pre>        stage(&#39;Deploy&#39;) {<br>            steps {<br>                sh &#39;docker stack deploy -c compose.yml flm&#39;<br>            }<br>        }<br>    }<br>}</pre><h3>📥 Step 1 — Source Code Checkout</h3><p>The Jenkins pipeline starts by pulling the latest application code from GitHub.</p><p>This ensures the pipeline always works on the latest codebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*0IE16VSnZiHznxk0mIMDuA.png" /></figure><h3>🔍 Step 2 — SonarQube Code Analysis</h3><p>Integrated SonarQube into Jenkins for:<br>✅ Static code analysis<br>✅ Vulnerability detection<br>✅ Code smell detection<br>✅ Quality gate validation</p><p>The pipeline validates the application before deployment.</p><h3>📦 Step 3 — Maven Build &amp; Packaging</h3><p>Used Maven to:</p><ul><li>Compile the application</li><li>Run validations</li><li>Generate WAR artifacts</li></ul><p>Command Used:</p><pre>mvn clean package</pre><h3>📁 Step 4 — Upload Artifact to Nexus</h3><p>After successful build:</p><ul><li>WAR artifacts are uploaded to Nexus Repository Manager</li><li>Versioning and centralized artifact management are maintained</li></ul><p>Benefits:<br>✔ Artifact reusability<br>✔ Version control<br>✔ Centralized storage</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*K97dVMo0l2rEVmOtdhuLiQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*uopt9xKQe6eTWOvi_4GFww.png" /></figure><h3>🐳 Step 5 — Docker Image Build</h3><p>Created Docker images for:</p><ul><li>Application Container</li><li>Database Container</li></ul><p>Commands:</p><pre>docker build -t saichandu27/automation:db Docker-db<br>docker build -t saichandu27/automation:app Docker-app</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*qD0JMRVX-vxUAgIg7Isolg.png" /></figure><h3>🔐 Step 6 — Security Scanning with Trivy</h3><p>Implemented DevSecOps best practices by scanning images using Trivy.</p><p>This helps detect:</p><ul><li>Critical vulnerabilities</li><li>High-risk packages</li><li>Misconfigurations</li></ul><p>Commands:</p><pre>trivy image saichandu27/automation:db<br>trivy image saichandu27/automation:app</pre><h3>🚀 Step 7 — Push Docker Images to Docker Hub</h3><p>After successful scanning:</p><ul><li>Images are pushed to Docker Hub Registry</li></ul><p>Commands:</p><pre>docker push saichandu27/automation:db<br>docker push saichandu27/automation:app</pre><h3>⚡ Step 8 — Deploy Application using Docker Swarm</h3><p>Used Docker Swarm orchestration for scalable deployment.</p><p>Deployment Command:</p><pre>docker stack deploy -c compose.yml flm</pre><p>Benefits:<br>✔ High availability<br>✔ Container orchestration<br>✔ Service scaling<br>✔ Production-style deployment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*Nlnkhm7vCFAN5fo_O-Rl4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*VVkUzXYBSO7jtJbKTPQaIA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*bf8zySICToDDudmdyt0Njw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*DnJPuJ1qH5PTxSf37F4ZcA.png" /></figure><h3>📊 Project Validation</h3><p>Successfully validated:<br>✅ Running Docker Containers<br>✅ Docker Swarm Nodes<br>✅ SonarQube Reports<br>✅ Nexus Artifacts<br>✅ Docker Hub Images<br>✅ Application UI<br>✅ MySQL Database Connectivity</p><p>The screenshots attached in the project demonstrate:</p><ul><li>Docker containers running successfully</li><li>SonarQube quality gate passed</li><li>Nexus artifact repository uploads</li><li>Docker Swarm cluster setup</li><li>Application login page</li><li>Database records verification</li></ul><h3>🌟 Key Learnings</h3><p>Through this project, I gained practical experience in:</p><p>✅ Jenkins Pipeline Automation<br>✅ Docker &amp; Containerization<br>✅ Docker Swarm Orchestration<br>✅ SonarQube Integration<br>✅ Nexus Repository Management<br>✅ DevSecOps Security Scanning<br>✅ CI/CD Best Practices<br>✅ Production Deployment Workflows</p><h3>📌 Conclusion</h3><p>This project helped me understand how modern DevOps pipelines automate the complete software delivery lifecycle — from code commit to production deployment.</p><p>Integrating security, quality analysis, artifact management, and orchestration into a single pipeline creates a reliable, scalable, and production-ready deployment process.</p><p>This was an excellent hands-on experience in implementing real-world DevOps and DevSecOps workflows.</p><h3>🔖 Tags</h3><p>#DevOps #Jenkins #Docker #DockerSwarm #CICD #Automation #SonarQube #Nexus #Trivy #Java #MySQL #DevSecOps #CloudComputing #Linux #Maven #ContinuousIntegration #ContinuousDelivery #DockerHub</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c53f66d9667" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Advanced Git & GitHub Workflows for DevOps Engineers — Day 24 to Day 28 of…]]></title>
            <link>https://medium.com/@saluvalasaichand/mastering-advanced-git-github-workflows-for-devops-engineers-day-24-to-day-28-of-38ece8227d5a?source=rss-b48b294e50c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/38ece8227d5a</guid>
            <dc:creator><![CDATA[Saichandu_Devops]]></dc:creator>
            <pubDate>Thu, 21 May 2026 03:17:23 GMT</pubDate>
            <atom:updated>2026-05-21T03:17:23.181Z</atom:updated>
            <content:encoded><![CDATA[<h3>Mastering Advanced Git &amp; GitHub Workflows for DevOps Engineers — Day 24 to Day 28 of #90DaysOfDevOps</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*i9vWuF_NPeBDTeK3eys_iw.png" /></figure><p>Git and GitHub are not just developer tools anymore — they are the backbone of modern DevOps, CI/CD, Infrastructure as Code, and GitOps workflows.</p><p>Over the last few days of my #90DaysOfDevOps journey, I focused on mastering:</p><ul><li>Advanced Git workflows</li><li>Merge vs Rebase</li><li>Git Reset vs Revert</li><li>GitHub CLI</li><li>GitHub branching</li><li>Revision and self-assessment</li></ul><p>These are real-world skills every DevOps Engineer and SRE should know before working in production environments.</p><h3>🚀 Day 24 — Advanced Git: Merge, Rebase, Stash &amp; Cherry Pick</h3><h3>📌 Why Advanced Git Matters</h3><p>As projects grow:</p><ul><li>Multiple developers work simultaneously</li><li>Branches diverge</li><li>Conflicts happen</li><li>Hotfixes become urgent</li></ul><p>Understanding advanced Git operations helps maintain:</p><ul><li>Clean history</li><li>Faster collaboration</li><li>Safer deployments</li></ul><h3>🔀 Git Merge</h3><h3>What is Merge?</h3><p>Git merge combines changes from one branch into another.</p><p>Example:</p><pre>git checkout main<br>git merge feature-login</pre><h3>Fast-Forward Merge</h3><p>Occurs when:</p><ul><li>Main branch has not moved ahead</li></ul><p>Git simply moves the pointer forward.</p><h3>Merge Commit</h3><p>Occurs when:</p><ul><li>Both branches have unique commits</li></ul><p>Git creates a special merge commit.</p><h3>🔄 Git Rebase</h3><h3>What is Rebase?</h3><p>Rebase rewrites commit history by moving commits onto another base.</p><p>Example:</p><pre>git checkout feature-dashboard<br>git rebase main</pre><h3>Merge vs Rebase</h3><p>MergeRebasePreserves historyCreates linear historyEasier collaborationCleaner historyCreates merge commitsRewrites commits</p><h3>Important Rule</h3><p>Never rebase commits already shared with others.</p><p>Why?</p><ul><li>Commit hashes change</li><li>Collaboration becomes difficult</li></ul><h3>📦 Git Stash</h3><h3>What is Stash?</h3><p>Temporarily stores uncommitted changes.</p><p>Example:</p><pre>git stash<br>git stash pop</pre><h3>Real-World Use Case</h3><p>Useful when:</p><ul><li>Urgent production issue appears</li><li>You need to switch branches quickly</li></ul><p>without losing unfinished work.</p><h3>🍒 Git Cherry Pick</h3><h3>What is Cherry Pick?</h3><p>Copies a specific commit from another branch.</p><p>Example:</p><pre>git cherry-pick &lt;commit-id&gt;</pre><h3>Real DevOps Use Case</h3><p>Useful for:</p><ul><li>Hotfixes</li><li>Production patches</li><li>Selective deployments</li></ul><h3>🚀 Day 25 — Git Reset vs Revert &amp; Branching Strategies</h3><h3>📌 Git Reset</h3><p>git reset changes branch history.</p><h3>Soft Reset</h3><pre>git reset --soft HEAD~1</pre><p>Removes commit but keeps staged changes.</p><h3>Mixed Reset</h3><pre>git reset --mixed HEAD~1</pre><p>Removes commit and unstages files.</p><h3>Hard Reset</h3><pre>git reset --hard HEAD~1</pre><p>Removes everything permanently.</p><p>⚠️ Dangerous operation.</p><h3>📌 Git Revert</h3><p>Creates a new commit that undoes previous changes.</p><p>Example:</p><pre>git revert &lt;commit-id&gt;</pre><h3>Reset vs Revert</h3><p>ResetRevertRewrites historyPreserves historyUnsafe for shared branchesSafe for shared branchesDestructiveSafer</p><h3>🌳 Branching Strategies</h3><h3>GitFlow</h3><p>Structure:</p><ul><li>main</li><li>develop</li><li>feature/*</li><li>release/*</li><li>hotfix/*</li></ul><p>Best for:</p><ul><li>Large enterprise teams</li></ul><h3>GitHub Flow</h3><p>Simple workflow:</p><ul><li>main branch</li><li>short feature branches</li></ul><p>Best for:</p><ul><li>Startups</li><li>Fast deployments</li></ul><h3>Trunk-Based Development</h3><p>Everyone commits frequently to:</p><ul><li>main/trunk</li></ul><p>Best for:</p><ul><li>CI/CD-heavy environments</li></ul><h3>🚀 Day 26 — GitHub CLI (gh)</h3><h3>📌 Why GitHub CLI Matters</h3><p>GitHub CLI allows engineers to:</p><ul><li>Manage repos</li><li>Create PRs</li><li>Handle issues</li><li>Monitor workflows</li></ul><p>directly from terminal.</p><h3>🔐 Install GitHub CLI</h3><p>Ubuntu:</p><pre>sudo apt install gh -y</pre><h3>🔑 Authenticate</h3><pre>gh auth login</pre><h3>📂 Repository Management</h3><h3>Create Repository</h3><pre>gh repo create devops-gh-cli-demo --public</pre><h3>Clone Repository</h3><pre>gh repo clone cli/cli</pre><h3>🐞 GitHub Issues</h3><h3>Create Issue</h3><pre>gh issue create</pre><h3>🔀 Pull Requests</h3><h3>Create PR</h3><pre>gh pr create --fill</pre><h3>Merge PR</h3><pre>gh pr merge</pre><h3>⚙️ GitHub Actions</h3><h3>View Workflow Runs</h3><pre>gh run list</pre><h3>📌 Real DevOps Use Cases</h3><p>GitHub CLI is useful for:</p><ul><li>CI/CD automation</li><li>GitOps workflows</li><li>Infrastructure management</li><li>Platform engineering</li></ul><h3>🚀 Day 27 — GitHub Profile Makeover</h3><h3>📌 Why GitHub Profile Matters</h3><p>Your GitHub profile is:</p><ul><li>Your technical portfolio</li><li>Public resume</li><li>Proof of work</li></ul><p>Recruiters check:</p><ul><li>Repository quality</li><li>Documentation</li><li>Commit consistency</li><li>DevOps projects</li></ul><p>before interviews.</p><h3>👨‍💻 GitHub Profile README</h3><p>Created a professional profile README including:</p><ul><li>Introduction</li><li>Skills</li><li>DevOps tools</li><li>Project links</li><li>Contact information</li></ul><h3>🛠️ Organized Repositories</h3><p>Structured repositories for:</p><ul><li>Shell scripts</li><li>DevOps notes</li><li>Kubernetes projects</li><li>Terraform projects</li><li>AWS projects</li></ul><h3>🚀 Day 28 — Revision Day</h3><h3>📌 Why Revision Matters</h3><p>Learning DevOps is impossible without revision.</p><p>Revision helps:</p><ul><li>Strengthen fundamentals</li><li>Identify weak areas</li><li>Improve troubleshooting confidence</li></ul><h3>📚 Topics Revised</h3><ul><li>Linux</li><li>Networking</li><li>Shell scripting</li><li>Git &amp; GitHub</li><li>GitHub CLI</li><li>LVM</li><li>Permissions</li><li>Cloud basics</li></ul><h3>🐧 Linux Revision</h3><p>Practiced:</p><ul><li>Process management</li><li>Services</li><li>Permissions</li><li>User management</li><li>Troubleshooting</li></ul><p>Commands:</p><pre>top<br>ps<br>systemctl<br>chmod<br>chown<br>df -h<br>free -h</pre><h3>🌐 Networking Revision</h3><p>Commands:</p><pre>ping<br>curl<br>dig<br>ss -tulpn</pre><p>Concepts revised:</p><ul><li>DNS</li><li>IP addressing</li><li>Ports</li><li>Subnets</li></ul><h3>🐚 Shell Scripting Revision</h3><p>Practiced:</p><ul><li>Variables</li><li>Loops</li><li>Functions</li><li>Error handling</li><li>Crontab</li></ul><p>Example:</p><pre>set -euo pipefail</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38ece8227d5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Day 22 & Day 23 — Git Fundamentals, Branching & Working with GitHub for DevOps Engineers]]></title>
            <link>https://medium.com/@saluvalasaichand/day-22-day-23-git-fundamentals-branching-working-with-github-for-devops-engineers-c31e1858629c?source=rss-b48b294e50c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/c31e1858629c</guid>
            <dc:creator><![CDATA[Saichandu_Devops]]></dc:creator>
            <pubDate>Wed, 20 May 2026 03:03:15 GMT</pubDate>
            <atom:updated>2026-05-20T03:03:15.989Z</atom:updated>
            <content:encoded><![CDATA[<p>Git is one of the most important tools in the DevOps ecosystem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*i9vWuF_NPeBDTeK3eys_iw.png" /></figure><p>Almost every modern DevOps workflow depends on:</p><ul><li>Version control</li><li>Collaboration</li><li>Branching strategies</li><li>CI/CD pipelines</li><li>Infrastructure as Code</li><li>GitOps workflows</li></ul><h3>Why Git Matters in DevOps</h3><p>Git acts as the foundation for:</p><ul><li>CI/CD pipelines</li><li>Kubernetes GitOps</li><li>Terraform repositories</li><li>Jenkins automation</li><li>Cloud infrastructure management</li><li>Team collaboration</li></ul><p>Without Git:</p><ul><li>Tracking changes becomes difficult</li><li>Rollbacks become risky</li><li>Collaboration becomes unstable</li><li>Automation pipelines break</li></ul><h3>Day 22 — Introduction to Git &amp; Your First Repository</h3><h3>What is Git?</h3><p>Git is a distributed version control system used to:</p><ul><li>Track source code changes</li><li>Maintain history</li><li>Collaborate safely</li><li>Restore previous versions</li></ul><p>Git helps engineers:</p><ul><li>Work on features independently</li><li>Maintain commit history</li><li>Audit changes</li><li>Roll back mistakes safely</li></ul><h3>Installing and Configuring Git</h3><h3>Verify Git Installation</h3><pre>git --version</pre><h3>Configure Git Username</h3><pre>git config --global user.name &quot;Saichandu Saluvala&quot;</pre><h3>Configure Git Email</h3><pre>git config --global user.email &quot;saluvalasaichandu@gmail.com&quot;</pre><h3>Verify Configuration</h3><pre>git config --list</pre><h3>Why Git Configuration Matters</h3><p>Git stores:</p><ul><li>Username</li><li>Email</li></ul><p>inside every commit for tracking ownership and collaboration.</p><h3>Creating Your First Git Repository</h3><h3>Create Project Directory</h3><pre>mkdir devops-git-practice</pre><h3>Navigate Into Directory</h3><pre>cd devops-git-practice</pre><h3>Initialize Repository</h3><pre>git init</pre><h3>What Does git init Do?</h3><p>git init creates the hidden:</p><pre>.git/</pre><p>directory.</p><p>This directory stores:</p><ul><li>Commit history</li><li>Branch information</li><li>Repository metadata</li><li>Configuration</li></ul><h3>Check Git Status</h3><pre>git status</pre><h3>Why git status Is Important</h3><p>git status shows:</p><ul><li>Untracked files</li><li>Modified files</li><li>Staged files</li><li>Current branch</li></ul><p>It is one of the most frequently used Git commands.</p><h3>Creating a Git Commands Reference</h3><p>Created:</p><pre>git-commands.md</pre><p>to maintain a personal Git command reference.</p><h3>Example Commands Added</h3><pre>git init<br>git status<br>git add<br>git commit<br>git log<br>git diff</pre><h3>Staging and Committing Changes</h3><h3>Stage File</h3><pre>git add git-commands.md</pre><h3>Commit Changes</h3><pre>git commit -m &quot;Added initial Git commands reference&quot;</pre><h3>Understanding Git Workflow</h3><p>Git workflow consists of:</p><p>ComponentPurposeWorking DirectoryCurrent project filesStaging AreaPrepared changesRepositoryPermanent commit history</p><h3>Git Workflow Diagram</h3><pre>Working Directory<br>       ↓<br>git add<br>       ↓<br>Staging Area<br>       ↓<br>git commit<br>       ↓<br>Git Repository</pre><h3>Viewing Commit History</h3><pre>git log --oneline</pre><h3>Why Commit History Matters</h3><p>Commit history helps:</p><ul><li>Track project evolution</li><li>Audit changes</li><li>Roll back mistakes</li><li>Debug production issues</li></ul><h3>Day 23 — Git Branching &amp; Working with GitHub</h3><h3>What is a Branch?</h3><p>A branch is an isolated line of development inside a Git repository.</p><p>Branches allow engineers to:</p><ul><li>Build features safely</li><li>Fix bugs independently</li><li>Avoid breaking production code</li></ul><h3>Why Branching Matters in DevOps</h3><p>Branching is heavily used in:</p><ul><li>CI/CD workflows</li><li>GitOps pipelines</li><li>Infrastructure automation</li><li>Kubernetes deployments</li></ul><p>Without branching:</p><ul><li>Collaboration becomes difficult</li><li>Production stability decreases</li><li>Feature isolation becomes impossible</li></ul><h3>Listing Branches</h3><pre>git branch</pre><h3>Create a New Branch</h3><pre>git branch feature-1</pre><h3>Switch to Branch</h3><pre>git switch feature-1</pre><h3>Create and Switch in One Command</h3><pre>git switch -c feature-2</pre><h3>Difference Between git switch and git checkout</h3><p>CommandPurposegit checkoutOlder multi-purpose commandgit switchModern branch-switching command</p><h3>Working on Feature Branches</h3><p>Added commits to:</p><pre>feature-1</pre><p>without affecting:</p><pre>main</pre><p>branch.</p><p>This demonstrates branch isolation.</p><h3>Delete Unused Branch</h3><pre>git branch -d feature-2</pre><h3>Understanding HEAD in Git</h3><p>HEAD points to:</p><ul><li>Current branch</li><li>Latest commit</li></ul><p>Example:</p><pre>HEAD -&gt; main</pre><h3>Working with GitHub</h3><h3>Create GitHub Repository</h3><p>Created:</p><pre>devops-git-practice</pre><p>repository on GitHub.</p><h3>Connect Local Repo to GitHub</h3><pre>git remote add origin https://github.com/username/devops-git-practice.git</pre><h3>Verify Remote</h3><pre>git remote -v</pre><h3>Push Main Branch</h3><pre>git push -u origin main</pre><h3>Push Feature Branch</h3><pre>git push -u origin feature-1</pre><h3>What is origin?</h3><p>origin refers to:</p><ul><li>Default remote GitHub repository</li></ul><h3>What is upstream?</h3><p>upstream refers to:</p><ul><li>Original repository from which a fork was created</li></ul><p>Used heavily in:</p><ul><li>Open-source workflows</li></ul><h3>Pulling Changes from GitHub</h3><h3>Pull Latest Changes</h3><pre>git pull origin main</pre><h3>Difference Between git fetch and git pull</h3><p>CommandPurposegit fetchDownloads changes onlygit pullDownloads and merges changes</p><h3>Clone vs Fork</h3><h3>Clone Repository</h3><pre>git clone https://github.com/user/repository.git</pre><h3>What is Clone?</h3><p>Clone:</p><ul><li>Downloads repository locally</li></ul><h3>What is Fork?</h3><p>Fork:</p><ul><li>Creates your own GitHub copy of repository</li></ul><p>Used heavily in:</p><ul><li>Open-source contributions</li></ul><h3>Difference Between Clone and Fork</h3><p>CloneForkLocal copyGitHub copyGit operationGitHub featureUsed for developmentUsed for collaboration</p><h3>Keeping Fork Updated</h3><h3>Add Upstream Remote</h3><pre>git remote add upstream https://github.com/original/repo.git</pre><h3>Fetch Upstream Changes</h3><pre>git fetch upstream</pre><h3>Merge Upstream Changes</h3><pre>git merge upstream/main</pre><h3>Real-World DevOps Use Cases</h3><p>Git and GitHub workflows are heavily used in:</p><ul><li>GitHub Actions</li><li>Jenkins pipelines</li><li>Kubernetes GitOps</li><li>Terraform repositories</li><li>Infrastructure automation</li><li>CI/CD deployments</li></ul><p>Examples:</p><ul><li>Managing Kubernetes YAML files</li><li>Tracking Terraform changes</li><li>Feature-based deployment workflows</li><li>Team collaboration across environments</li></ul><h3>Key Learnings from Day 22 &amp; Day 23</h3><ul><li>Learned Git fundamentals</li><li>Understood Git workflow</li><li>Practiced staging and commits</li><li>Learned branching concepts</li><li>Worked with GitHub remotes</li><li>Understood clone vs fork</li><li>Practiced push and pull workflows</li></ul><h3>Conclusion</h3><p>Git is one of the foundational technologies in DevOps engineering.</p><p>Understanding:</p><ul><li>Repositories</li><li>Commits</li><li>Branches</li><li>Remotes</li><li>GitHub workflows</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c31e1858629c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Day 20 & Day 21 — Advanced Bash Scripting, Log Analyzer Project & DevOps Shell Scripting Cheat…]]></title>
            <link>https://medium.com/@saluvalasaichand/day-20-day-21-advanced-bash-scripting-log-analyzer-project-devops-shell-scripting-cheat-ee2f614553e9?source=rss-b48b294e50c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee2f614553e9</guid>
            <dc:creator><![CDATA[Saichandu_Devops]]></dc:creator>
            <pubDate>Mon, 18 May 2026 05:04:18 GMT</pubDate>
            <atom:updated>2026-05-18T05:04:18.767Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 Day 20 &amp; Day 21 — Advanced Bash Scripting, Log Analyzer Project &amp; DevOps Shell Scripting Cheat Sheet</h3><p>As part of my #90DaysOfDevOps journey, I spent the last two days focusing on one of the most important DevOps skills: Shell Scripting.</p><p>In real-world production environments, shell scripting is heavily used for:</p><ul><li>Infrastructure automation</li><li>Log analysis</li><li>Monitoring</li><li>CI/CD pipelines</li><li>Deployment automation</li><li>Kubernetes administration</li><li>Linux troubleshooting</li></ul><p>Day 20 focused on building a real-world Bash project, while Day 21 focused on consolidating all scripting knowledge into a reusable DevOps Shell Scripting Cheat Sheet.</p><h3>Day 20 — Bash Scripting Challenge: Log Analyzer &amp; Report Generator</h3><h3>Project Objective</h3><p>As DevOps engineers, one of our common responsibilities is analyzing logs generated by servers and applications.</p><p>The goal of this project was to build a Bash script called:</p><pre>log_analyzer.sh</pre><p>This script automates:</p><ul><li>Log analysis</li><li>Error detection</li><li>Critical event identification</li><li>Summary report generation</li></ul><h3>Why Log Analysis Matters in DevOps</h3><p>Logs are one of the most important troubleshooting sources during incidents.</p><p>Engineers use logs to:</p><ul><li>Identify failures</li><li>Debug applications</li><li>Monitor systems</li><li>Detect security issues</li><li>Analyze outages</li></ul><p>In production environments, manual log analysis becomes difficult when log files grow large.</p><p>Automation helps reduce troubleshooting time significantly.</p><h3>Task 1 — Input Validation</h3><p>The script accepts:</p><ul><li>Log file path as a command-line argument</li></ul><p>The script validates:</p><ul><li>Whether argument is provided</li><li>Whether file exists</li></ul><h3>Example Validation Logic</h3><pre>#!/bin/bash</pre><pre>if [ $# -eq 0 ]; then<br>    echo &quot;Usage: ./log_analyzer.sh &lt;logfile&gt;&quot;<br>    exit 1<br>fi</pre><pre>if [ ! -f &quot;$1&quot; ]; then<br>    echo &quot;Log file not found!&quot;<br>    exit 1<br>fi</pre><h3>Why Validation Matters</h3><p>Input validation prevents:</p><ul><li>Invalid script execution</li><li>Runtime failures</li><li>Incorrect analysis</li></ul><p>This is heavily used in production automation scripts.</p><h3>Task 2 — Error Count</h3><p>The script identifies:</p><ul><li>ERROR</li><li>Failed</li></ul><p>inside logs and counts occurrences.</p><h3>Error Count Command</h3><pre>grep -Ei &quot;ERROR|Failed&quot; sample_log.log | wc -l</pre><h3>Example Output</h3><pre>Total Errors: 48</pre><h3>Why Error Counts Matter</h3><p>Error trends help identify:</p><ul><li>Application instability</li><li>Infrastructure failures</li><li>Security issues</li><li>Service degradation</li></ul><h3>Task 3 — Critical Events Detection</h3><p>The script identifies:</p><ul><li>CRITICAL events</li><li>Line numbers</li></ul><h3>Critical Event Detection</h3><pre>grep -n &quot;CRITICAL&quot; sample_log.log</pre><h3>Example Output</h3><pre>Line 84: CRITICAL Disk space below threshold<br>Line 217: CRITICAL Database connection lost</pre><h3>Why Critical Event Detection Matters</h3><p>Critical events often indicate:</p><ul><li>Database outages</li><li>Storage failures</li><li>Service crashes</li><li>Infrastructure emergencies</li></ul><p>These events usually require immediate investigation.</p><h3>Task 4 — Top 5 Error Messages</h3><p>The script extracts:</p><ul><li>Most common error messages</li><li>Occurrence counts</li></ul><h3>Command Used</h3><pre>grep &quot;ERROR&quot; sample_log.log | \<br>awk &#39;{$1=$2=$3=&quot;&quot;; print}&#39; | \<br>sort | uniq -c | sort -rn | head -5</pre><h3>Example Output</h3><pre>45 Connection timed out<br>32 File not found<br>28 Permission denied<br>15 Disk I/O error<br>9 Out of memory</pre><h3>Why This Matters</h3><p>Top recurring errors help identify:</p><ul><li>Repeated failures</li><li>Misconfigurations</li><li>Infrastructure bottlenecks</li><li>Frequent application issues</li></ul><h3>Task 5 — Summary Report Generation</h3><p>The script generated:</p><ul><li>Date of analysis</li><li>Log file name</li><li>Total lines processed</li><li>Total error count</li><li>Top error messages</li><li>Critical events</li></ul><h3>Example Report File</h3><pre>log_report_2026-02-11.txt</pre><h3>Sample Report Content</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EkZ6u_tLdeTLkqhtO5OVWg.png" /></figure><pre>Date: 2026-02-11<br>Log File: sample_log.log</pre><pre>Total Errors: 48</pre><pre>Top Errors:<br>45 Connection timed out<br>32 File not found</pre><pre>Critical Events:<br>Line 84: Disk space below threshold</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9g7r9ByAZUeGUqPq98oGkA.png" /></figure><h3>Task 6 — Archive Processed Logs</h3><p>The script also:</p><ul><li>Created archive directory</li><li>Moved processed logs</li><li>Confirmed archival completion</li></ul><h3>Archive Command</h3><pre>mkdir -p archive<br>mv sample_log.log archive/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eYy2l5mdIXFfApJbPrVqKA.png" /></figure><h3>Real-World DevOps Applications</h3><p>This project simulates real production tasks such as:</p><ul><li>Log monitoring</li><li>Incident investigation</li><li>SIEM preprocessing</li><li>Monitoring automation</li><li>Production troubleshooting</li></ul><p>Shell scripting is heavily used for:</p><ul><li>Linux log parsing</li><li>Kubernetes troubleshooting</li><li>Monitoring alerts</li><li>CI/CD automation</li></ul><h3>Day 21 — Shell Scripting Cheat Sheet</h3><p>After several days of learning shell scripting concepts, I consolidated everything into a reusable DevOps Shell Scripting Cheat Sheet.</p><p>The goal was to create a quick-reference guide for:</p><ul><li>Linux administration</li><li>Automation</li><li>Troubleshooting</li><li>Interview preparation</li><li>Daily DevOps tasks</li></ul><h3>Topics Covered in the Cheat Sheet</h3><p>The cheat sheet included:</p><ul><li>Variables</li><li>Loops</li><li>Functions</li><li>Arguments</li><li>Conditionals</li><li>Text processing commands</li><li>Error handling</li><li>Debugging</li><li>Useful DevOps one-liners</li></ul><h3>Shell Scripting Basics</h3><h3>Shebang</h3><p>Defines the interpreter for the script.</p><pre>#!/bin/bash</pre><h3>Running Scripts</h3><pre>chmod +x script.sh<br>./script.sh</pre><h3>Variables</h3><pre>NAME=&quot;DevOps&quot;<br>echo $NAME</pre><h3>User Input</h3><pre>read -p &quot;Enter Name: &quot; NAME</pre><h3>Command-Line Arguments</h3><p>VariableMeaning$0Script name$1First argument$#Total arguments$@All arguments</p><h3>Loops in Shell Scripting</h3><h3>For Loop</h3><pre>for i in 1 2 3<br>do<br>    echo $i<br>done</pre><h3>While Loop</h3><pre>COUNT=1</pre><pre>while [ $COUNT -le 5 ]<br>do<br>    echo $COUNT<br>    COUNT=$((COUNT+1))<br>done</pre><h3>Functions</h3><pre>greet() {</pre><pre>    echo &quot;Hello&quot;<br>}</pre><h3>Text Processing Commands</h3><h3>grep</h3><p>Search patterns inside files.</p><pre>grep -i &quot;error&quot; app.log</pre><h3>awk</h3><p>Extract structured data.</p><pre>awk -F: &#39;{print $1}&#39; /etc/passwd</pre><h3>sed</h3><p>Replace text inside files.</p><pre>sed -i &#39;s/foo/bar/g&#39; config.txt</pre><h3>tail -f</h3><p>Monitor logs in real time.</p><pre>tail -f app.log</pre><h3>Useful DevOps One-Liners</h3><h3>Delete Old Files</h3><pre>find /tmp -type f -mtime +7 -delete</pre><h3>Monitor Disk Usage</h3><pre>df -h</pre><h3>Check Service Status</h3><pre>systemctl status nginx</pre><h3>Real-Time Error Monitoring</h3><pre>tail -f app.log | grep ERROR</pre><h3>Error Handling &amp; Debugging</h3><h3>Strict Mode</h3><pre>set -euo pipefail</pre><h3>Debug Mode</h3><pre>set -x</pre><h3>Exit Codes</h3><pre>echo $?</pre><h3>Why This Cheat Sheet Matters</h3><p>This cheat sheet acts as:</p><ul><li>A quick reference guide</li><li>A revision document</li><li>A troubleshooting companion</li><li>A DevOps interview preparation resource</li></ul><h3>Key Learnings from Day 20 &amp; Day 21</h3><ul><li>Built a real-world log analyzer project</li><li>Learned automated log parsing</li><li>Practiced advanced Bash scripting</li><li>Improved troubleshooting skills</li><li>Built a reusable shell scripting cheat sheet</li><li>Learned practical DevOps automation patterns</li></ul><h3>Real-World DevOps Applications</h3><p>Shell scripting is heavily used in:</p><ul><li>Kubernetes automation</li><li>Jenkins pipelines</li><li>Monitoring systems</li><li>Linux administration</li><li>Cloud provisioning</li><li>Backup automation</li><li>Deployment workflows</li></ul><p>Examples:</p><ul><li>Restart failed services automatically</li><li>Monitor CPU and memory usage</li><li>Parse logs for failures</li><li>Automate deployments</li><li>Generate infrastructure reports</li></ul><h3>Conclusion</h3><p>Shell scripting remains one of the strongest foundational skills for every DevOps and SRE Engineer.</p><p>Understanding:</p><ul><li>Log analysis</li><li>Error handling</li><li>Automation scripting</li><li>Text processing</li><li>Monitoring workflows</li></ul><p>helps engineers build reliable, scalable, and production-ready automation systems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee2f614553e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 19 of #90DaysOfDevOps — Log Rotation, Backups & Crontab ️]]></title>
            <link>https://medium.com/@saluvalasaichand/day-19-of-90daysofdevops-log-rotation-backups-crontab-%EF%B8%8F-8fce5acb2785?source=rss-b48b294e50c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fce5acb2785</guid>
            <dc:creator><![CDATA[Saichandu_Devops]]></dc:creator>
            <pubDate>Thu, 14 May 2026 03:53:11 GMT</pubDate>
            <atom:updated>2026-05-14T03:53:11.620Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Day 19 is where we put that to real use — building scripts that actually run on servers, automatically, every night, without anyone touching them.</em></p><h3>What We Built Today</h3><p>Script Job log_rotate.sh Compress old logs, delete ancient ones backup.sh Archive a folder with today&#39;s date maintenance.sh Run both, log everything with timestamps</p><p>Let’s go through each one.</p><h3>Script 1 — Log Rotation</h3><p>Logs pile up fast. Left unchecked, they fill your disk and take down your server. The fix is simple: compress the old ones, delete the ancient ones.</p><pre>#!/bin/bash<br>set -euo pipefail</pre><pre>LOG_DIR=&quot;$1&quot;</pre><pre>if [[ ! -d &quot;$LOG_DIR&quot; ]]; then<br>    echo &quot;ERROR: Folder &#39;$LOG_DIR&#39; not found.&quot;<br>    exit 1<br>fi</pre><pre>echo &quot;Starting log rotation for: $LOG_DIR&quot;</pre><pre># Compress .log files older than 7 days<br>find &quot;$LOG_DIR&quot; -name &quot;*.log&quot; -mtime +7 -exec gzip {} \;<br>echo &quot;Old .log files compressed.&quot;</pre><pre># Delete .gz files older than 30 days<br>find &quot;$LOG_DIR&quot; -name &quot;*.gz&quot; -mtime +30 -delete<br>echo &quot;Very old .gz files deleted.&quot;</pre><pre>echo &quot;Log rotation done!&quot;</pre><p>Run it like this:</p><pre>./log_rotate.sh /var/log/myapp</pre><p>Output:</p><pre>Starting log rotation for: /var/log/myapp<br>Old .log files compressed.<br>Very old .gz files deleted.<br>Log rotation done!</pre><p>The two find commands do all the heavy lifting:</p><pre>find &quot;$LOG_DIR&quot; -name &quot;*.log&quot; -mtime +7 -exec gzip {} \;<br># Find .log files older than 7 days → compress each one</pre><pre>find &quot;$LOG_DIR&quot; -name &quot;*.gz&quot; -mtime +30 -delete<br># Find .gz files older than 30 days → delete each one</pre><p>-mtime +7 means &quot;modified more than 7 days ago.&quot; That&#39;s it. One flag does what would take 10 lines of manual date comparison.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*KdNj0RuigmtkDa9mH7QZmg.png" /></figure><h3>Script 2 — Server Backup</h3><p>Every backup should be timestamped — so you always know exactly when it was taken, and you can restore to a specific date.</p><pre>#!/bin/bash<br>set -euo pipefail</pre><pre>SOURCE=&quot;$1&quot;<br>DEST=&quot;$2&quot;</pre><pre>if [[ ! -d &quot;$SOURCE&quot; ]]; then<br>    echo &quot;ERROR: Source folder &#39;$SOURCE&#39; not found.&quot;<br>    exit 1<br>fi</pre><pre>mkdir -p &quot;$DEST&quot;</pre><pre>FILENAME=&quot;backup-$(date +%Y-%m-%d).tar.gz&quot;</pre><pre>tar -czf &quot;$DEST/$FILENAME&quot; &quot;$SOURCE&quot;<br>echo &quot;Backup created: $FILENAME&quot;<br>echo &quot;Size: $(du -sh &quot;$DEST/$FILENAME&quot; | cut -f1)&quot;</pre><pre>find &quot;$DEST&quot; -name &quot;backup-*.tar.gz&quot; -mtime +14 -delete<br>echo &quot;Old backups cleaned up.&quot;</pre><p>Run it like this:</p><pre>./backup.sh /var/www/myapp /backups</pre><p>Output:</p><pre>Backup created: backup-2026-05-13.tar.gz<br>Size: 145M<br>Old backups cleaned up.</pre><p>Three things worth understanding here:</p><pre>FILENAME=&quot;backup-$(date +%Y-%m-%d).tar.gz&quot;<br># $(date +%Y-%m-%d) gives you: 2026-05-13<br># So the file becomes: backup-2026-05-13.tar.gz</pre><pre>tar -czf &quot;$DEST/$FILENAME&quot; &quot;$SOURCE&quot;<br># -c = create a new archive<br># -z = compress it with gzip<br># -f = save it to this filename</pre><pre>find &quot;$DEST&quot; -name &quot;backup-*.tar.gz&quot; -mtime +14 -delete<br># Auto-cleanup: remove backups older than 14 days</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*WoBRWPeb6xnqsBAHvlRoeQ.png" /></figure><h3>Script 3 — Maintenance Runner</h3><p>Instead of scheduling two separate cron jobs, one script calls both and logs every step with a timestamp. When something breaks at 2 AM, this log is all you have.</p><pre>#!/bin/bash<br>set -euo pipefail</pre><pre>LOG_FILE=&quot;/var/log/maintenance.log&quot;</pre><pre>log() {<br>    echo &quot;[$(date &#39;+%Y-%m-%d %H:%M:%S&#39;)] $1&quot; | tee -a &quot;$LOG_FILE&quot;<br>}</pre><pre>log &quot;===== Maintenance Started =====&quot;</pre><pre>log &quot;Running log rotation...&quot;<br>bash /home/ubuntu/scripts/log_rotate.sh /var/log/myapp &gt;&gt; &quot;$LOG_FILE&quot; 2&gt;&amp;1<br>log &quot;Log rotation done.&quot;</pre><pre>log &quot;Running backup...&quot;<br>bash /home/ubuntu/scripts/backup.sh /var/www/myapp /backups &gt;&gt; &quot;$LOG_FILE&quot; 2&gt;&amp;1<br>log &quot;Backup done.&quot;</pre><pre>log &quot;===== Maintenance Finished =====&quot;</pre><p>What /var/log/maintenance.log looks like after it runs:</p><pre>[2026-05-13 01:00:00] ===== Maintenance Started =====<br>[2026-05-13 01:00:00] Running log rotation...<br>[2026-05-13 01:00:02] Log rotation done.<br>[2026-05-13 01:00:02] Running backup...<br>[2026-05-13 01:00:08] Backup done.<br>[2026-05-13 01:00:08] ===== Maintenance Finished =====</pre><p>The log() function is the most reusable thing I wrote today. It prints to screen and saves to file at the same time using tee.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YHffc7fcFCLaoTHkI9rC1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JQ14nB_jBiArTANHnWXUDw.png" /></figure><h3>Scheduling with Crontab</h3><p>Cron runs commands on a schedule. The syntax looks weird at first but becomes second nature quickly.</p><pre>*    *    *    *    *     command<br>  │    │    │    │    │<br>  │    │    │    │    └───  Day of week (0=Sunday)<br>  │    │    │    └────────  Month (1–12)<br>  │    │    └─────────────  Day of month (1–31)<br>  │    └──────────────────  Hour (0–23)<br>  └───────────────────────  Minute (0–59)</pre><p>Here are the cron entries for today’s scripts:</p><pre># Log rotation — every day at 2:00 AM<br>0 2 * * * /home/ubuntu/scripts/log_rotate.sh /var/log/myapp</pre><pre># Backup — every Sunday at 3:00 AM<br>0 3 * * 0 /home/ubuntu/scripts/backup.sh /var/www/myapp /backups</pre><pre># Health check — every 5 minutes<br>*/5 * * * * /home/ubuntu/scripts/health_check.sh</pre><pre># Maintenance — every day at 1:00 AM<br>0 1 * * * /home/ubuntu/scripts/maintenance.sh</pre><p>To add these:</p><pre>crontab -e    # opens the editor<br>crontab -l    # view what&#39;s scheduled</pre><blockquote><strong><em>The rule that saves hours of debugging:</em></strong><em> Always use full paths in cron. Cron runs in a minimal environment with no idea where your scripts live. </em><em>/home/ubuntu/scripts/backup.sh works. </em><em>./backup.sh does not.</em></blockquote><h3>3 Things That Clicked Today</h3><p><strong>1. </strong><strong>find does in one line what used to take 10</strong></p><p>Before today I would have written a loop to check file ages manually. find with -mtime and -exec or -delete handles the whole thing — find, filter by age, act. One line.</p><p><strong>2. Timestamps on backups and logs are non-negotiable</strong></p><p>backup-2026-05-13.tar.gz tells you exactly when the backup was taken. A log entry starting with [2026-05-13 01:00:02] tells you exactly when something happened. Without timestamps, debugging is guesswork.</p><p><strong>3. One maintenance script beats many cron jobs</strong></p><p>Five separate cron jobs means five places to check when something fails. One maintenance.sh that calls everything means one log file, one place to look, and one cron entry to manage.</p><h3>Test It Safely First</h3><p>Before running anything on a real server, test with throwaway folders:</p><pre>mkdir -p /tmp/test-logs /tmp/test-source /tmp/test-backups</pre><pre># Fake an old log file<br>touch -d &quot;10 days ago&quot; /tmp/test-logs/app.log</pre><pre># Test log rotation<br>./log_rotate.sh /tmp/test-logs</pre><pre># Test backup<br>echo &quot;hello&quot; &gt; /tmp/test-source/data.txt<br>./backup.sh /tmp/test-source /tmp/test-backups</pre><p>Everything happens in /tmp/ — nothing touches your real system.</p><p>If this helped you, follow along — I’m sharing everything I learn, day by day.</p><p><em>Part of my #90DaysOfDevOps challenge with </em><strong><em>TrainWithShubham</em></strong><em>.</em></p><p><em>#90DaysOfDevOps </em><em>#DevOpsKaJosh </em><em>#TrainWithShubham </em><em>#Linux </em><em>#BashScripting </em><em>#ShellScript </em><em>#DevOps </em><em>#Crontab </em><em>#Automation</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fce5acb2785" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 18-Shell Scripting Like a Pro: Functions, Strict Mode & Real-World Patterns]]></title>
            <link>https://medium.com/@saluvalasaichand/day-18-shell-scripting-like-a-pro-functions-strict-mode-real-world-patterns-1ad1b73aa3fa?source=rss-b48b294e50c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ad1b73aa3fa</guid>
            <dc:creator><![CDATA[Saichandu_Devops]]></dc:creator>
            <pubDate>Thu, 14 May 2026 03:52:44 GMT</pubDate>
            <atom:updated>2026-05-14T03:52:44.335Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 18 of #90DaysOfDevOps — Functions</h3><p><em>If you’ve ever looked at a Bash script and thought “this is a mess of commands duct-taped together” — you’re not wrong. That’s exactly what most Bash scripts look like before you learn functions and strict mode. Today on Day 18 of my #90DaysOfDevOps journey, I crossed that line. Here’s everything I learned.</em></p><h3>Why Intermediate Scripting Matters</h3><p>Most DevOps engineers start with Bash scripts that are just a linear list of commands. It works — until it doesn’t. The real problems start when:</p><ul><li>A script silently uses an <strong>undefined variable</strong> and produces garbage output</li><li>A failed command in a <strong>pipe chain goes undetected</strong> and corrupts downstream data</li><li>You copy-paste the same 5 lines across 10 different scripts</li><li>Someone else (or future you) has to read what you wrote</li></ul><p>That’s exactly the problem that <strong>functions</strong> and set -euo pipefail solve. Let&#39;s break it down.</p><h3>🔧 Task 1: Writing Your First Functions</h3><p>Functions in Bash are simple — but they unlock a completely different style of scripting. Here’s the syntax:</p><pre>function_name() {<br>    # body<br>}</pre><p>I created functions.sh with two basic functions:</p><pre>#!/bin/bash</pre><pre>greet() {<br>    local name=&quot;$1&quot;<br>    echo &quot;Hello, ${name}!&quot;<br>}</pre><pre>add() {<br>    local num1=&quot;$1&quot;<br>    local num2=&quot;$2&quot;<br>    local result=$(( num1 + num2 ))<br>    echo &quot;Sum of ${num1} and ${num2} = ${result}&quot;<br>}</pre><pre># Call them<br>greet &quot;Saichandu&quot;<br>add 10 25</pre><p><strong>Output:</strong></p><pre>Hello, Saichandu!<br>Sum of 10 and 25 = 35</pre><p>Simple — but notice I’m already using local on every variable. More on why that matters in Task 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*bkFcy7cnlLBrtEg3HaUfgA.png" /></figure><h3>💾 Task 2: Functions with “Return Values”</h3><p>Here’s something that trips up most beginners: <strong>Bash functions don’t return values like Python or JavaScript do.</strong> return in Bash only returns an exit code (0–255).</p><p>So how do you get data out of a function? You echo it and capture it with $().</p><pre>#!/bin/bash</pre><pre>check_disk() {<br>    echo &quot;===== Disk Usage (/) =====&quot;<br>    df -h /<br>    echo &quot;&quot;<br>}</pre><pre>check_memory() {<br>    echo &quot;===== Memory Usage =====&quot;<br>    free -h<br>    echo &quot;&quot;<br>}</pre><pre># Main<br>check_disk<br>check_memory</pre><p><strong>Output:</strong></p><pre>===== Disk Usage (/) =====<br>Filesystem      Size  Used Avail Use% Mounted on<br>/dev/xvda1       20G  6.2G   14G  32% /</pre><pre>===== Memory Usage =====<br>               total        used        free      shared  buff/cache   available<br>Mem:           3.8Gi       1.2Gi       1.5Gi        45Mi       1.1Gi       2.4Gi<br>Swap:          2.0Gi          0B       2.0Gi</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kb7tdWSDhm8Y2fmdJ_qb8Q.png" /></figure><blockquote><strong><em>Key insight:</em></strong><em> Functions in Bash are output-producers. Use </em><em>echo to &quot;return&quot; data, and </em><em>$(function_name) to capture it.</em></blockquote><h3>🛡️ Task 3: The Most Important Line in Any Bash Script</h3><pre>set -euo pipefail</pre><p>I’d seen this in scripts before and always skipped over it. After today, I’ll never write a script without it.</p><p>Here’s what each flag does:</p><h3>set -e — Exit on Error</h3><p>Without it:</p><pre>ls /nonexistent    # prints error<br>echo &quot;I still run&quot;  # silently continues — dangerous!</pre><p>With set -e:</p><pre>ls /nonexistent    # script STOPS here<br>echo &quot;I still run&quot;  # never reached</pre><h3>set -u — Treat Unset Variables as Errors</h3><p>Without it:</p><pre>echo &quot;Hello $NAEM&quot;   # typo — prints &quot;Hello &quot; silently</pre><p>With set -u:</p><pre>echo &quot;Hello $NAEM&quot;   # bash: NAEM: unbound variable — stops immediately</pre><p>This one has saved me from so many typo bugs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fesK_Cbmont21lrWUPOtOg.png" /></figure><h3>set -o pipefail — Catch Failures in Pipes</h3><p>Without it:</p><pre>cat /nonexistent_file | grep &quot;data&quot;<br># cat fails, but grep exits 0 — the pipe &quot;succeeds&quot;!</pre><p>With pipefail:</p><pre>cat /nonexistent_file | grep &quot;data&quot;<br># The pipeline returns cat&#39;s non-zero exit code — caught!</pre><p><strong>The full demo script:</strong></p><pre>#!/bin/bash<br>set -euo pipefail</pre><pre># Safe to use undefined? No.<br># echo $UNDEFINED_VAR  → unbound variable error</pre><pre># Safe to ignore failures? No.<br># ls /fake             → exits immediately</pre><pre># Safe to ignore pipe failures? No.<br># cat /fake | grep x   → pipefail catches it</pre><pre>echo &quot;Script completed safely.&quot;</pre><blockquote><strong><em>Rule of thumb:</em></strong><em> Every script you write should start with </em><em>#!/bin/bash and </em><em>set -euo pipefail. No exceptions.</em></blockquote><h3>🧩 Task 4: Local Variables — The Hidden Bug Factory</h3><p>This is the one that catches almost everyone. In Bash, <strong>variables are global by default</strong> — even inside functions.</p><pre>#!/bin/bash</pre><pre># WITHOUT local — dangerous<br>bad_function() {<br>    MY_VAR=&quot;I was changed inside the function!&quot;<br>}</pre><pre># WITH local — safe<br>good_function() {<br>    local MY_VAR=&quot;I stay inside the function&quot;<br>}</pre><pre>MY_VAR=&quot;Original&quot;</pre><pre>bad_function<br>echo $MY_VAR    # &quot;I was changed inside the function!&quot; — oops</pre><pre>MY_VAR=&quot;Original&quot;<br>good_function<br>echo $MY_VAR    # &quot;Original&quot; — safe!</pre><p><strong>Full output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*paLjPWsXLDNkbW1LzG6DEA.png" /></figure><pre>=== Testing LOCAL variable ===<br>[Before call] MY_VAR = Original Value<br>[Inside good_function] MY_VAR = I am LOCAL<br>[After call]  MY_VAR = Original Value     ← unchanged ✅</pre><pre>=== Testing GLOBAL variable (no local) ===<br>[Before call] MY_VAR = Original Value<br>[Inside bad_function] MY_VAR = I am GLOBAL<br>[After call]  MY_VAR = I am GLOBAL        ← modified ❌</pre><blockquote><strong><em>Always use </em></strong><strong><em>local inside functions.</em></strong><em> The only exception is when you intentionally want to modify global state — and even then, document it clearly.</em></blockquote><h3>🚀 Task 5: Putting It All Together — System Info Reporter</h3><p>The capstone task was building a full system_info.sh script that uses <strong>functions for everything</strong>, starts with strict mode, and produces clean readable output.</p><pre>#!/bin/bash<br>set -euo pipefail</pre><pre>print_header() {<br>    local title=&quot;$1&quot;<br>    echo &quot;&quot;<br>    echo &quot;════════════════════════════════════════&quot;<br>    echo &quot;  ${title}&quot;<br>    echo &quot;════════════════════════════════════════&quot;<br>}</pre><pre>get_system_info() {<br>    print_header &quot;🖥️  System Information&quot;<br>    echo &quot;  Hostname   : $(hostname)&quot;<br>    echo &quot;  OS         : $(grep PRETTY_NAME /etc/os-release | cut -d= -f2 | tr -d &#39;&quot;&#39;)&quot;<br>    echo &quot;  Kernel     : $(uname -r)&quot;<br>    echo &quot;  Architecture: $(uname -m)&quot;<br>}</pre><pre>get_uptime() {<br>    print_header &quot;⏱️  System Uptime&quot;<br>    echo &quot;  $(uptime -p)&quot;<br>    echo &quot;  Since: $(uptime -s)&quot;<br>}</pre><pre>get_disk_usage() {<br>    print_header &quot;💾 Disk Usage (Top Mounts by Use%)&quot;<br>    df -h --output=source,size,used,avail,pcent,target \<br>        | grep -v tmpfs | sort -rk5 | head -6<br>}</pre><pre>get_memory_usage() {<br>    print_header &quot;🧠 Memory Usage&quot;<br>    free -h<br>}</pre><pre>get_top_processes() {<br>    print_header &quot;🔥 Top 5 CPU-Consuming Processes&quot;<br>    printf &quot;  %-8s %-10s %-6s %-6s %s\n&quot; &quot;PID&quot; &quot;USER&quot; &quot;%CPU&quot; &quot;%MEM&quot; &quot;COMMAND&quot;<br>    echo &quot;  ─────────────────────────────────────────&quot;<br>    ps aux --sort=-%cpu \<br>        | awk &#39;NR&gt;1 {printf &quot;  %-8s %-10s %-6s %-6s %s\n&quot;, $2, $1, $3, $4, $11}&#39; \<br>        | head -5<br>}</pre><pre>main() {<br>    echo &quot;╔══════════════════════════════════════════╗&quot;<br>    echo &quot;║        SYSTEM INFO REPORTER              ║&quot;<br>    echo &quot;║    Generated: $(date &#39;+%Y-%m-%d %H:%M:%S&#39;)       ║&quot;<br>    echo &quot;╚══════════════════════════════════════════╝&quot;</pre><pre>    get_system_info<br>    get_uptime<br>    get_disk_usage<br>    get_memory_usage<br>    get_top_processes</pre><pre>    echo &quot;&quot;<br>    echo &quot;  ✅ Report Complete&quot;<br>}</pre><pre>main</pre><p><strong>Sample output:</strong></p><pre>╔══════════════════════════════════════════╗<br>║        SYSTEM INFO REPORTER              ║<br>║    Generated: 2026-05-13 10:32:47       ║<br>╚══════════════════════════════════════════╝</pre><pre>════════════════════════════════════════<br>  🖥️  System Information<br>════════════════════════════════════════<br>  Hostname   : devops-server-01<br>  OS         : Ubuntu 22.04.3 LTS<br>  Kernel     : 5.15.0-91-generic<br>  Architecture: x86_64</pre><pre>════════════════════════════════════════<br>  ⏱️  System Uptime<br>════════════════════════════════════════<br>  up 3 days, 4 hours, 12 minutes<br>  Since: 2026-05-10 06:20:35</pre><pre>════════════════════════════════════════<br>  🔥 Top 5 CPU-Consuming Processes<br>════════════════════════════════════════<br>  PID      USER       %CPU   %MEM   COMMAND<br>  ─────────────────────────────────────────<br>  1532     ubuntu     12.3   2.1    /usr/bin/python3<br>  894      root       5.4    0.8    /usr/sbin/dockerd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r0I9QSykUHZyDxGanvFR3A.png" /></figure><h3>📌 3 Key Takeaways from Day 18</h3><h3>1. Functions are the single biggest quality upgrade for Bash scripts</h3><p>Before functions, every script is a long flat list of commands. Functions introduce <strong>modularity, reusability, and testability</strong>. A function with a clear name (get_memory_usage) is documentation in itself.</p><h3>2. set -euo pipefail is non-negotiable for production scripts</h3><p>Bash’s default behavior is to silently fail and continue. That’s fine for one-liners at the terminal. It’s catastrophic in automation. Three characters (-euo) transform Bash from a silent failure machine into a strict, fail-fast runtime.</p><h3>3. local is not optional — it&#39;s defensive programming</h3><p>Bash’s global-by-default variable scope is a trap. A single missing local can cause a function to silently corrupt variables in the calling scope. Use local on every variable inside every function, always.</p><h3>🛠️ Quick Reference Cheat Sheet</h3><pre># Strict mode — always at the top<br>#!/bin/bash<br>set -euo pipefail</pre><pre># Function syntax<br>my_function() {<br>    local arg1=&quot;$1&quot;<br>    local arg2=&quot;${2:-default_value}&quot;  # with default<br>    echo &quot;Result: ${arg1}&quot;<br>}</pre><pre># Call a function<br>my_function &quot;hello&quot;</pre><pre># Capture function output<br>result=$(my_function &quot;hello&quot;)</pre><pre># Check last exit code<br>echo &quot;Exit: $?&quot;</pre><pre># Function with conditional return<br>is_file() {<br>    local path=&quot;$1&quot;<br>    [[ -f &quot;$path&quot; ]] &amp;&amp; return 0 || return 1<br>}</pre><p>If you found this useful, follow along on my GitHub for all the scripts: 2026/day-18/</p><p><em>This post is part of my #90DaysOfDevOps challenge with </em><strong><em>TrainWithShubham</em></strong><em>.</em></p><p><em>Tags: </em><em>#90DaysOfDevOps </em><em>#DevOpsKaJosh </em><em>#TrainWithShubham </em><em>#Linux </em><em>#BashScripting </em><em>#ShellScript </em><em>#DevOps </em><em>#CloudEngineering</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ad1b73aa3fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Day 17 — Shell Scripting: Loops, Arguments & Error Handling for DevOps Engineers]]></title>
            <link>https://medium.com/@saluvalasaichand/day-17-shell-scripting-loops-arguments-error-handling-for-devops-engineers-e2f37831f6b5?source=rss-b48b294e50c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2f37831f6b5</guid>
            <dc:creator><![CDATA[Saichandu_Devops]]></dc:creator>
            <pubDate>Tue, 12 May 2026 15:27:32 GMT</pubDate>
            <atom:updated>2026-05-12T15:27:32.453Z</atom:updated>
            <content:encoded><![CDATA[<p>Shell scripting is one of the most powerful skills for every DevOps and SRE Engineer.</p><p>As infrastructure grows, engineers cannot manually perform repetitive tasks continuously.</p><p>Shell scripting helps automate:</p><ul><li>Server administration</li><li>Package installation</li><li>Monitoring</li><li>Backup operations</li><li>Deployment workflows</li><li>CI/CD automation</li><li>Kubernetes operations</li></ul><p>As part of Day 17 of my #90DaysOfDevOps journey, I focused on:</p><ul><li>For loops</li><li>While loops</li><li>Command-line arguments</li><li>Package installation automation</li><li>Error handling in shell scripts</li><li>Root user validation</li></ul><h3>Why Shell Scripting Matters in DevOps</h3><p>Shell scripting is heavily used in:</p><ul><li>CI/CD pipelines</li><li>Infrastructure automation</li><li>Monitoring systems</li><li>Cloud provisioning</li><li>Linux server management</li></ul><p>Without scripting:</p><ul><li>Operations become repetitive</li><li>Human errors increase</li><li>Automation becomes difficult</li></ul><h3>Task 1 — For Loop</h3><h3>What is a For Loop?</h3><p>A for loop repeats commands for multiple items.</p><p>Used heavily in:</p><ul><li>Iterating servers</li><li>Processing files</li><li>Installing packages</li><li>Kubernetes automation</li></ul><h3>Create for_loop.sh</h3><h3>Command</h3><pre>vim for_loop.sh</pre><h3>Script Content</h3><pre>#!/bin/bash</pre><pre>for fruit in Apple Mango Banana Orange Grapes<br>do<br>    echo &quot;Fruit: $fruit&quot;<br>done</pre><h3>Make Script Executable</h3><pre>chmod +x for_loop.sh</pre><h3>Execute Script</h3><pre>./for_loop.sh</pre><h3>Output</h3><pre>Fruit: Apple<br>Fruit: Mango<br>Fruit: Banana<br>Fruit: Orange<br>Fruit: Grapes</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*Fb_m7IcFiOZUKnyUhWVmeQ.png" /></figure><h3>Create count.sh</h3><h3>Script Content</h3><pre>#!/bin/bash</pre><pre>for i in {1..10}<br>do<br>    echo $i<br>done</pre><h3>Execute Script</h3><pre>chmod +x count.sh<br>./count.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*-10ZXO3GFQwdBXPB4k7pdg.png" /></figure><h3>Output</h3><pre>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10</pre><h3>Task 2 — While Loop</h3><h3>What is a While Loop?</h3><p>A while loop runs continuously while a condition remains true.</p><p>Used heavily in:</p><ul><li>Monitoring scripts</li><li>Infinite loops</li><li>Health checks</li><li>Automation polling</li></ul><h3>Create countdown.sh</h3><h3>Command</h3><pre>vim countdown.sh</pre><h3>Script Content</h3><pre>#!/bin/bash</pre><pre>read -p &quot;Enter a number: &quot; NUM</pre><pre>while [ $NUM -ge 0 ]<br>do<br>    echo $NUM<br>    NUM=$((NUM-1))<br>done</pre><pre>echo &quot;Done!&quot;</pre><h3>Execute Script</h3><pre>chmod +x countdown.sh<br>./countdown.sh</pre><h3>Example Output</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*NWWZD1F4fsnhQykDM32saQ.png" /></figure><pre>Enter a number: 5</pre><pre>5<br>4<br>3<br>2<br>1<br>0</pre><pre>Done!</pre><h3>Task 3 — Command-Line Arguments</h3><h3>What are Arguments?</h3><p>Arguments allow users to pass values while running scripts.</p><p>Examples:</p><ul><li>Server names</li><li>Environment names</li><li>File paths</li><li>Deployment versions</li></ul><h3>Understanding Special Variables</h3><p>VariableMeaning$0Script name$1First argument$2Second argument$#Total arguments$@All arguments</p><h3>Create greet.sh</h3><h3>Command</h3><pre>vim greet.sh</pre><h3>Script Content</h3><pre>#!/bin/bash</pre><pre>if [ -z &quot;$1&quot; ]<br>then<br>    echo &quot;Usage: ./greet.sh &lt;name&gt;&quot;</pre><pre>else<br>    echo &quot;Hello, $1!&quot;<br>fi</pre><h3>Execute Script</h3><pre>chmod +x greet.sh<br>./greet.sh Saichandu</pre><h3>Output</h3><pre>Hello, Saichandu!</pre><h3>Run Without Argument</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*j0xzfu9UHB1uS80aZ_g_-g.png" /></figure><pre>./greet.sh</pre><h3>Output</h3><pre>Usage: ./greet.sh &lt;name&gt;</pre><h3>Create args_demo.sh</h3><h3>Script Content</h3><pre>#!/bin/bash</pre><pre>echo &quot;Script Name: $0&quot;<br>echo &quot;Total Arguments: $#&quot;<br>echo &quot;All Arguments: $@&quot;</pre><h3>Execute Script</h3><pre>chmod +x args_demo.sh<br>./args_demo.sh DevOps AWS Kubernetes</pre><h3>Output</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*WC9QXFIT83tbfs53POj63g.png" /></figure><pre>Script Name: ./args_demo.sh<br>Total Arguments: 3<br>All Arguments: DevOps AWS Kubernetes</pre><h3>Task 4 — Install Packages via Script</h3><h3>Why Package Automation Matters</h3><p>In DevOps environments, package installation is automated using scripts.</p><p>Examples:</p><ul><li>Installing Docker</li><li>Installing monitoring agents</li><li>Configuring Kubernetes nodes</li></ul><h3>Create install_packages.sh</h3><h3>Command</h3><pre>vim install_packages.sh</pre><h3>Script Content</h3><pre>#!/bin/bash</pre><pre>if [ &quot;$EUID&quot; -ne 0 ]<br>then<br>    echo &quot;Please run as root&quot;<br>    exit 1<br>fi</pre><pre>PACKAGES=&quot;nginx curl wget&quot;</pre><pre>for pkg in $PACKAGES<br>do</pre><pre>    if rpm -q $pkg &amp;&gt; /dev/null<br>    then<br>        echo &quot;$pkg is already installed&quot;</pre><pre>    else<br>        echo &quot;Installing $pkg...&quot;</pre><pre>        yum install -y $pkg</pre><pre>        echo &quot;$pkg installed successfully&quot;<br>    fi</pre><pre>done</pre><h3>Execute Script</h3><pre>chmod +x install_packages.sh<br>sudo ./install_packages.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*p0UyKZ7TAr7pNnzqPLDaHA.png" /></figure><h3>Example Output</h3><pre>nginx is already installed<br>curl is already installed<br>Installing wget...<br>wget installed successfully</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H81HkDjc3KlHJXAbq9M9Og.png" /></figure><h3>Task 5 — Error Handling</h3><h3>Why Error Handling Matters</h3><p>Error handling prevents scripts from continuing after failures.</p><p>Used heavily in:</p><ul><li>Production automation</li><li>CI/CD pipelines</li><li>Deployment scripts</li><li>Infrastructure provisioning</li></ul><h3>What is set -e?</h3><pre>set -e</pre><p>Stops script execution immediately if any command fails.</p><h3>Create safe_script.sh</h3><h3>Command</h3><pre>vim safe_script.sh</pre><h3>Script Content</h3><pre>#!/bin/bash</pre><pre>set -e</pre><pre>mkdir /tmp/devops-test || echo &quot;Directory already exists&quot;</pre><pre>cd /tmp/devops-test || echo &quot;Failed to enter directory&quot;</pre><pre>touch demo.txt || echo &quot;Failed to create file&quot;</pre><pre>echo &quot;Script executed successfully&quot;</pre><h3>Execute Script</h3><pre>chmod +x safe_script.sh<br>./safe_script.sh</pre><h3>Example Output</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UYWAlnEAoDcdHmHx1ZhkYA.png" /></figure><pre>Script executed successfully</pre><h3>Understanding Important Shell Concepts</h3><h3>For Loop Syntax</h3><pre>for item in list<br>do<br>    commands<br>done</pre><h3>While Loop Syntax</h3><pre>while [ condition ]<br>do<br>    commands<br>done</pre><h3>Root User Check</h3><pre>if [ &quot;$EUID&quot; -ne 0 ]</pre><p>Ensures script runs with administrative privileges.</p><h3>Error Handling using ||</h3><pre>mkdir test || echo &quot;Error&quot;</pre><p>Runs the right-side command if the left-side command fails.</p><h3>Real-World DevOps Use Cases</h3><p>Shell scripting is heavily used in:</p><ul><li>Jenkins pipelines</li><li>Kubernetes automation</li><li>AWS EC2 bootstrap scripts</li><li>Monitoring scripts</li><li>Backup automation</li><li>Docker management</li><li>Linux administration</li></ul><p>Examples:</p><ul><li>Automatically install required packages</li><li>Monitor disk usage</li><li>Restart failed services</li><li>Automate deployments</li></ul><h3>Key Learnings</h3><ul><li>Learned for loops and while loops</li><li>Understood command-line arguments</li><li>Automated package installation</li><li>Practiced script error handling</li><li>Implemented root privilege validation</li><li>Built reusable automation scripts</li></ul><h3>Scripts Practiced</h3><pre>for_loop.sh<br>count.sh<br>countdown.sh<br>greet.sh<br>args_demo.sh<br>install_packages.sh<br>safe_script.sh</pre><h3>Conclusion</h3><p>Shell scripting is a foundational DevOps skill that enables automation, consistency, and operational efficiency.</p><p>Understanding:</p><ul><li>Loops</li><li>Arguments</li><li>Error handling</li><li>Automation scripting</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2f37831f6b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Day 16 — Shell Scripting Basics for DevOps Engineers]]></title>
            <link>https://medium.com/@saluvalasaichand/day-16-shell-scripting-basics-for-devops-engineers-cb47aebaae5c?source=rss-b48b294e50c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb47aebaae5c</guid>
            <dc:creator><![CDATA[Saichandu_Devops]]></dc:creator>
            <pubDate>Tue, 12 May 2026 14:39:33 GMT</pubDate>
            <atom:updated>2026-05-12T14:39:33.472Z</atom:updated>
            <content:encoded><![CDATA[<p>Shell scripting is one of the most important foundational skills for every DevOps and SRE Engineer.</p><p>In real-world environments, DevOps engineers constantly use shell scripts for:</p><ul><li>Automation</li><li>Monitoring</li><li>CI/CD pipelines</li><li>Server health checks</li><li>Backup tasks</li><li>Log analysis</li><li>Deployment automation</li><li>Kubernetes operations</li></ul><p>Shell scripting helps reduce:</p><ul><li>Manual repetitive work</li><li>Human errors</li><li>Operational effort</li></ul><p>As part of Day 16 of my #90DaysOfDevOps journey, I focused on:</p><ul><li>Understanding shebang (#!/bin/bash)</li><li>Working with variables</li><li>Taking user input using read</li><li>Writing if-else conditions</li><li>Checking file existence</li><li>Automating service checks</li></ul><h3>What is Shell Scripting?</h3><p>Shell scripting is the process of writing Linux commands inside a file and executing them automatically.</p><p>Instead of manually running commands repeatedly, scripts automate operational tasks.</p><h3>Why Shell Scripting Matters in DevOps</h3><p>Shell scripting is heavily used in:</p><ul><li>Jenkins pipelines</li><li>Kubernetes automation</li><li>Infrastructure management</li><li>Monitoring systems</li><li>Deployment automation</li><li>Cron jobs</li><li>Docker management</li><li>Linux server administration</li></ul><h3>Task 1 — Your First Shell Script</h3><h3>Understanding Shebang</h3><p>The shebang line:</p><pre>#!/bin/bash</pre><p>tells Linux which interpreter should execute the script.</p><h3>Create hello.sh</h3><h3>Command</h3><pre>vim hello.sh</pre><h3>Script Content</h3><pre>#!/bin/bash</pre><pre>echo &quot;Hello, DevOps!&quot;</pre><h3>Make Script Executable</h3><pre>chmod +x hello.sh</pre><h3>Execute Script</h3><pre>./hello.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*N6vJYjOpcX_ZuTJI6j_-6w.png" /></figure><h3>Output</h3><pre>Hello, DevOps!</pre><h3>What Happens Without Shebang?</h3><p>Without:</p><pre>#!/bin/bash</pre><p>the system may:</p><ul><li>Use the default shell</li><li>Fail to interpret some commands</li><li>Produce syntax errors</li></ul><h3>Task 2 — Variables in Shell Scripting</h3><h3>What are Variables?</h3><p>Variables temporarily store data.</p><p>Examples:</p><ul><li>User names</li><li>Server IPs</li><li>Environment values</li><li>Service names</li></ul><h3>Create variables.sh</h3><h3>Command</h3><pre>vim variables.sh</pre><h3>Script Content</h3><pre>#!/bin/bash</pre><pre>NAME=&quot;Saichandu&quot;<br>ROLE=&quot;DevOps Engineer&quot;</pre><pre>echo &quot;Hello, I am $NAME and I am a $ROLE&quot;</pre><h3>Run Script</h3><pre>chmod +x variables.sh<br>./variables.sh</pre><h3>Output</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*ybHZfX8kFs--7tkpukFlOA.png" /></figure><pre>Hello, I am Saichandu and I am a DevOps Engineer</pre><h3>Single Quotes vs Double Quotes</h3><h3>Double Quotes</h3><pre>echo &quot;Hello $NAME&quot;</pre><h3>Output</h3><pre>Hello Saichandu</pre><p>Variables expand successfully.</p><h3>Single Quotes</h3><pre>echo &#39;Hello $NAME&#39;</pre><h3>Output</h3><pre>Hello $NAME</pre><p>Variables do not expand.</p><h3>Task 3 — User Input using read</h3><h3>What is read?</h3><p>read accepts user input dynamically.</p><p>Used heavily in:</p><ul><li>Automation scripts</li><li>Interactive scripts</li><li>Deployment confirmations</li><li>Monitoring tools</li></ul><h3>Create greet.sh</h3><h3>Command</h3><pre>vim greet.sh</pre><h3>Script Content</h3><pre>#!/bin/bash</pre><pre>read -p &quot;Enter your name: &quot; NAME<br>read -p &quot;Enter your favourite tool: &quot; TOOL</pre><pre>echo &quot;Hello $NAME, your favourite tool is $TOOL&quot;</pre><h3>Run Script</h3><pre>chmod +x greet.sh<br>./greet.sh</pre><h3>Example Output</h3><pre>Enter your name: Saichandu<br>Enter your favourite tool: Kubernetes</pre><pre>Hello Saichandu, your favourite tool is Kubernetes</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*ifx75BZLVkp2mK12OYhLRg.png" /></figure><h3>Task 4 — If-Else Conditions</h3><h3>Why Conditions Matter</h3><p>Conditions help scripts make decisions.</p><p>Used heavily in:</p><ul><li>Health checks</li><li>Monitoring systems</li><li>CI/CD pipelines</li><li>Deployment automation</li></ul><h3>Create check_number.sh</h3><h3>Command</h3><pre>vim check_number.sh</pre><h3>Script Content</h3><pre>#!/bin/bash</pre><pre>read -p &quot;Enter a number: &quot; NUM</pre><pre>if [ $NUM -gt 0 ]; then<br>    echo &quot;Positive Number&quot;</pre><pre>elif [ $NUM -lt 0 ]; then<br>    echo &quot;Negative Number&quot;</pre><pre>else<br>    echo &quot;Zero&quot;<br>fi</pre><h3>Execute Script</h3><pre>chmod +x check_number.sh<br>./check_number.sh</pre><h3>Example Output</h3><pre>Enter a number: 10<br>Positive Number</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*HSUG5ZiIdnYzF6I9txGknQ.png" /></figure><h3>File Existence Check</h3><h3>Create file_check.sh</h3><h3>Command</h3><pre>vim file_check.sh</pre><h3>Script Content</h3><pre>#!/bin/bash</pre><pre>read -p &quot;Enter filename: &quot; FILE</pre><pre>if [ -f &quot;$FILE&quot; ]; then<br>    echo &quot;File exists&quot;</pre><pre>else<br>    echo &quot;File does not exist&quot;<br>fi</pre><h3>Execute Script</h3><pre>chmod +x file_check.sh<br>./file_check.sh</pre><h3>Example Output</h3><pre>Enter filename: hello.sh<br>File exists</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*NbAED8KiLHn_8Nl8qoF5fw.png" /></figure><h3>Task 5 — Service Status Automation</h3><h3>Real DevOps Automation Example</h3><p>This script checks Linux service status automatically.</p><h3>Create server_check.sh</h3><h3>Command</h3><pre>vim server_check.sh</pre><h3>Script Content</h3><pre>#!/bin/bash</pre><pre>SERVICE=&quot;nginx&quot;</pre><pre>read -p &quot;Do you want to check the status? (y/n): &quot; OPTION</pre><pre>if [ &quot;$OPTION&quot; == &quot;y&quot; ]; then</pre><pre>    systemctl status $SERVICE</pre><pre>    if systemctl is-active --quiet $SERVICE; then<br>        echo &quot;$SERVICE is active&quot;</pre><pre>    else<br>        echo &quot;$SERVICE is not active&quot;<br>    fi</pre><pre>else<br>    echo &quot;Skipped.&quot;<br>fi</pre><h3>Execute Script</h3><pre>chmod +x server_check.sh<br>./server_check.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*4I1RTvavoHdzbtgoa284cQ.png" /></figure><h3>Example Output</h3><pre>Do you want to check the status? (y/n): y</pre><pre>nginx is active</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Tz3--YG5eSd7vBPOYEKpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*TSs4yJZBJHaoobqrdeV5hA.png" /></figure><h3>Understanding Important Shell Concepts</h3><h3>Variables</h3><pre>NAME=&quot;Saichandu&quot;</pre><p>No spaces around =.</p><h3>Conditions</h3><pre>if [ condition ]; then</pre><p>Used for decision-making.</p><h3>File Check</h3><pre>if [ -f filename ]</pre><p>Checks whether file exists.</p><h3>Executable Permission</h3><pre>chmod +x script.sh</pre><p>Makes script executable.</p><h3>Real-World DevOps Use Cases</h3><p>Shell scripting is heavily used in:</p><ul><li>Kubernetes automation</li><li>Jenkins pipelines</li><li>Backup scripts</li><li>Monitoring scripts</li><li>Server health checks</li><li>Docker automation</li><li>Deployment pipelines</li></ul><p>Examples:</p><ul><li>Restart failed services automatically</li><li>Monitor CPU and memory</li><li>Automate deployments</li><li>Rotate logs periodically</li></ul><h3>Key Learnings</h3><ul><li>Understood shebang and interpreters</li><li>Learned variables and string handling</li><li>Practiced user input using read</li><li>Built conditional logic using if-else</li><li>Performed file existence checks</li><li>Automated Linux service status checks</li></ul><h3>Scripts Practiced</h3><pre>hello.sh<br>variables.sh<br>greet.sh<br>check_number.sh<br>file_check.sh<br>server_check.sh</pre><h3>Conclusion</h3><p>Shell scripting is one of the strongest foundational skills for every DevOps and SRE Engineer.</p><p>Understanding:</p><ul><li>Variables</li><li>User input</li><li>Conditions</li><li>File checks</li><li>Service automation</li></ul><p>helps engineers automate repetitive operational tasks efficiently.</p><p>The stronger your shell scripting fundamentals become, the easier advanced DevOps automation tools like Jenkins, Ansible, Kubernetes automation, and CI/CD pipelines will feel.</p><p>#90DaysOfDevOps<br>#DevOpsKaJosh<br>#TrainWithShubham<br>#ShellScripting<br>#Linux<br>#DevOps<br>#SRE<br>#CloudComputing</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb47aebaae5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Day 11, Day 12 & Day 13 — Linux File Ownership, Revision & LVM Storage Management for DevOps…]]></title>
            <link>https://medium.com/@saluvalasaichand/day-11-day-12-day-13-linux-file-ownership-revision-lvm-storage-management-for-devops-236dd6443013?source=rss-b48b294e50c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/236dd6443013</guid>
            <dc:creator><![CDATA[Saichandu_Devops]]></dc:creator>
            <pubDate>Mon, 11 May 2026 15:03:09 GMT</pubDate>
            <atom:updated>2026-05-11T15:03:09.838Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 Day 11, Day 12 &amp; Day 13 — Linux File Ownership, Revision &amp; LVM Storage Management for DevOps Engineers</h3><p>Linux Administration is one of the strongest foundations for every DevOps and SRE Engineer.</p><p>In real-world production environments, engineers constantly work on:</p><ul><li>File ownership management</li><li>User and group permissions</li><li>Service troubleshooting</li><li>Storage expansion</li><li>Disk management</li><li>Linux system administration</li></ul><h3>🔐 Day 11 — Linux File Ownership (chown &amp; chgrp)</h3><h3>📌 Why File Ownership Matters</h3><p>Every file and directory in Linux has:</p><ul><li>Owner</li><li>Group</li></ul><p>Ownership controls:</p><ul><li>Who can access files</li><li>Who can modify applications</li><li>Which teams can collaborate safely</li></ul><p>This is heavily used in:</p><ul><li>CI/CD pipelines</li><li>Docker containers</li><li>Shared deployment servers</li><li>Kubernetes volumes</li><li>Log management</li></ul><h3>🔍 Understanding Ownership</h3><h3>Check File Ownership</h3><pre>ls -l</pre><h3>Example Output</h3><pre>-rw-r--r-- 1 ubuntu ubuntu devops-file.txt</pre><h3>Breakdown</h3><p>SectionMeaningubuntuOwnerubuntuGroup</p><h3>🔧 Using chown</h3><h3>📌 What is chown?</h3><p>chown = Change Owner</p><p>Used to transfer ownership of files and directories.</p><h3>🔹 Change File Owner</h3><pre>sudo chown tokyo devops-file.txt</pre><h3>🔹 Change Owner and Group Together</h3><pre>sudo chown professor:heist-team project-config.yaml</pre><h3>👥 Using chgrp</h3><h3>📌 What is chgrp?</h3><p>chgrp = Change Group</p><p>Used for shared team access.</p><h3>🔹 Change Group Ownership</h3><pre>sudo chgrp heist-team team-notes.txt</pre><h3>🔄 Recursive Ownership</h3><h3>📌 Why Recursive Ownership Matters</h3><p>Applications contain:</p><ul><li>Subdirectories</li><li>Config files</li><li>Logs</li><li>Scripts</li></ul><p>Recursive ownership simplifies management.</p><h3>🔹 Recursive Ownership Change</h3><pre>sudo chown -R professor:planners heist-project/</pre><h3>🎯 Real-World DevOps Use Cases</h3><p>Ownership management is heavily used in:</p><ul><li>Jenkins workspaces</li><li>Docker volumes</li><li>Kubernetes persistent storage</li><li>Nginx web directories</li><li>Shared deployment servers</li></ul><h3>🔁 Day 12 — Linux Fundamentals Revision</h3><h3>📌 Why Revision Matters</h3><p>Revision strengthens:</p><ul><li>Command-line confidence</li><li>Troubleshooting speed</li><li>Linux fundamentals</li><li>Incident response capabilities</li></ul><p>Production troubleshooting becomes much easier when Linux basics become muscle memory.</p><h3>⚙️ Process &amp; Service Revision</h3><h3>🔹 Check Running Processes</h3><pre>ps -ef | head</pre><h3>🔹 Monitor System Resources</h3><pre>top</pre><h3>🔹 Check Service Health</h3><pre>systemctl status docker</pre><h3>🔹 View Service Logs</h3><pre>journalctl -u docker -n 20</pre><h3>📂 File Operations Revision</h3><h3>🔹 Create File</h3><pre>touch revision-notes.txt</pre><h3>🔹 Append Data</h3><pre>echo &quot;Revision Day Practice&quot; &gt;&gt; revision-notes.txt</pre><h3>🔹 Change Permissions</h3><pre>chmod 640 revision-notes.txt</pre><h3>🔹 Change Ownership</h3><pre>sudo chown revision-user revision-notes.txt</pre><h3>💽 Day 13 — Linux Volume Management (LVM)</h3><h3>📌 Why LVM Matters</h3><p>Traditional partitions are difficult to resize dynamically.</p><p>LVM (Logical Volume Manager) provides:<br>✅ Flexible storage management<br>✅ Dynamic volume resizing<br>✅ Easier disk expansion<br>✅ Better storage abstraction</p><p>LVM is heavily used in:</p><ul><li>Cloud virtual machines</li><li>Kubernetes worker nodes</li><li>Database servers</li><li>CI/CD servers</li><li>Log storage systems</li></ul><h3>🏗️ LVM Architecture</h3><pre>Disk → Physical Volume (PV) → Volume Group (VG) → Logical Volume (LV)</pre><h3>🔍 Step 1 — Check Available Storage</h3><h3>Command</h3><pre>lsblk</pre><h3>Output from My Server</h3><pre>nvme0n1   8G<br>nvme1n1  10G</pre><p>The additional 10 GB disk (nvme1n1) was used for LVM setup.</p><h3>🧱 Step 2 — Create Physical Volume (PV)</h3><h3>📌 What is PV?</h3><p>Physical Volume is the actual disk used by LVM.</p><h3>🔹 Create PV</h3><pre>pvcreate /dev/nvme1n1</pre><h3>Output</h3><pre>Physical volume &quot;/dev/nvme1n1&quot; successfully created.</pre><h3>🔹 Verify PV</h3><pre>pvs</pre><h3>Output</h3><pre>/dev/sdf lvm2 10.00g</pre><h3>🏗️ Step 3 — Create Volume Group (VG)</h3><h3>📌 What is VG?</h3><p>Volume Group acts as a storage pool created from Physical Volumes.</p><h3>🔹 Create VG</h3><pre>vgcreate devops-vg /dev/nvme1n1</pre><h3>Output</h3><pre>Volume group &quot;devops-vg&quot; successfully created</pre><h3>🔹 Verify VG</h3><pre>vgs</pre><h3>Output</h3><pre>VG         #PV #LV VSize<br>devops-vg   1   0  10.00g</pre><h3>📦 Step 4 — Create Logical Volume (LV)</h3><h3>📌 What is LV?</h3><p>Logical Volume acts like a flexible virtual partition.</p><h3>🔹 Create LV</h3><pre>lvcreate -L 5G -n mylv devops-vg</pre><h3>Output</h3><pre>Logical volume &quot;mylv&quot; created.</pre><h3>🔹 Verify LV</h3><pre>lvs</pre><h3>Output</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vtumsvMdnmGO3DSdr4uNTQ.png" /></figure><pre>LV    VG         LSize<br>mylv  devops-vg  5.00g</pre><h3>🗂️ Step 5 — Format Logical Volume</h3><h3>📌 Why Formatting is Required</h3><p>Before mounting:</p><ul><li>Filesystem must be created</li></ul><h3>🔹 Create ext4 Filesystem</h3><pre>mkfs.ext4 /dev/devops-vg/mylv</pre><h3>Observation</h3><p>Filesystem created successfully.</p><h3>📁 Step 6 — Mount Logical Volume</h3><h3>🔹 Create Mount Point</h3><pre>mkdir /data</pre><h3>🔹 Mount Volume</h3><p>Initially, I ran:</p><pre>mount /dev/devops-vg/mylv</pre><h3>✅ Correct Mount Command</h3><pre>mount /dev/devops-vg/mylv /data</pre><h3>🔹 Verify Mounted Volume</h3><pre>df -h /data</pre><h3>Output</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ljDrBg-DRzMCpeHyLkwlUg.png" /></figure><pre>/dev/mapper/devops--vg-mylv  4.9G</pre><p>The Logical Volume was mounted successfully.</p><h3>🧪 Test Mounted Storage</h3><h3>Create Test File</h3><pre>touch /data/test.txt</pre><h3>🔍 Understanding LVM Workflow</h3><pre>Disk<br> ↓<br>Physical Volume (PV)<br> ↓<br>Volume Group (VG)<br> ↓<br>Logical Volume (LV)<br> ↓<br>Filesystem<br> ↓<br>Mount Point</pre><h3>🚨 Real-World DevOps Use Cases</h3><p>LVM is heavily used in:</p><ul><li>Kubernetes worker nodes</li><li>Jenkins build servers</li><li>Database servers</li><li>Docker storage</li><li>Log storage systems</li><li>Monitoring servers</li></ul><p>Examples:</p><ul><li>Extend database storage dynamically</li><li>Increase CI/CD artifact storage</li><li>Expand container volumes without downtime</li></ul><h3>✅ Commands Practiced</h3><pre>chown<br>chgrp<br>chown -R<br>ps -ef<br>top<br>systemctl status<br>journalctl<br>pvcreate<br>vgcreate<br>lvcreate<br>mkfs.ext4<br>mount<br>df -h<br>lsblk<br>pvs<br>vgs<br>lvs</pre><h3>🏁 Conclusion</h3><p>Linux administration, ownership management, troubleshooting, and storage management are foundational skills for every DevOps and SRE Engineer.</p><p>Understanding:</p><ul><li>Ownership and permissions</li><li>Services and logs</li><li>Linux troubleshooting</li><li>Flexible storage management with LVM</li></ul><p>#90DaysOfDevOps<br>#DevOpsKaJosh<br>#TrainWithShubham<br>#Linux<br>#LVM<br>#DevOps<br>#SRE<br>#CloudComputing</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=236dd6443013" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>