Bash Scripting for DevOps — Part 10/? Till now, my scripts worked. But everything inside them was hardcoded. So every time I wanted to run it for a different environment, I had to go and change the script. That didn’t feel right. In real DevOps workflows, we don’t change the script. We change the environment. For example: ENV=staging ./deploy.sh Inside the script: echo "Deploying to $ENV environment" Now the same script works for dev, staging, and prod without changing the code. Just by changing the input. Small change in approach, but this is what makes scripts flexible and reusable. And this is used everywhere — CI/CD, Docker, Kubernetes. #DevOps #BashScripting #Linux #Automation #DevOpsJourney #LearningInPublic
Bash Scripting for DevOps with Environment Variables
More Relevant Posts
-
DevOps Zero to Job-Ready – Day 13/180 | Functions & Arguments in Bash As scripts grow, repeating the same logic becomes hard to manage. Functions help organize code and reuse logic in one place. Arguments (`$1`, `$2`) make scripts flexible and reusable. Instead of repeating commands, define once and call when needed. More structured DevOps notes and scenarios available on www.engidock.com Next: Real script — backup automation #DevOps #Linux #Automation #EngiDock
To view or add a comment, sign in
-
Bash Scripting for DevOps — Part 11/? Till now, I was passing values using environment variables. That worked. But I realized something. Sometimes, I don’t want to set variables separately.I just want to pass values directly when running the script. That’s where arguments come in. In Bash, we can pass values like this: ./deploy.sh staging Inside the script, we can access it using: echo "Deploying to $1 environment" Here, $1 means the first argument. So if I run: ./deploy.sh prod It becomes: Deploying to prod environment This makes scripts much more flexible. Instead of editing the script or setting variables, I can just pass what I need at runtime. This is used a lot in real DevOps workflows: • passing environment names • passing versions or tags • controlling script behavior dynamically Small change. But now the script feels more like a real tool, not just a fixed set of commands. #DevOps #BashScripting #Linux #Automation #DevOpsJourney #LearningInPublic
To view or add a comment, sign in
-
Day 17 of #90DaysOfDevOps 💻🔥 Today I dived deeper into Shell Scripting and learned how to make scripts more powerful and practical. ✔ Practiced for & while loops ✔ Worked with command-line arguments ($1, $#, $@) ✔ Built small scripts to automate tasks ✔ Learned basic error handling 💡 Biggest learning: Using arguments makes scripts reusable and dynamic — not just static commands. ⚡ Real-world DevOps use: Shell scripts are used daily for automation, deployments, monitoring, and backups. Consistency is building confidence 🚀 #DevOps #Linux #ShellScripting #Automation #90DaysOfDevOps
To view or add a comment, sign in
-
#Day_9 – Mastering Shell Scripting Basics (Linux & DevOps) Today, I went deeper into Shell Scripting, and now I can build more practical and useful scripts. 💡 What I learned today (in very simple terms): 🔹 Conditional Logic (Advanced) if-elif-else – handle multiple conditions case – cleaner way to handle options Makes scripts more dynamic 🔹 Arguments in Scripts $1, $2 – take input from command line $# – number of arguments $@ – all arguments Helps create flexible scripts 🔹 Scheduling with Cron Jobs crontab -e – schedule tasks Run scripts automatically at fixed time Very useful in automation 🔹 Logging & Debugging Store output in log files Use set -x for debugging Track errors easily 🔥 What I realized today: Shell scripting is a powerful automation tool Scheduling tasks saves a lot of manual effort Real DevOps work depends on automation + monitoring Excited to move towards advanced DevOps tools next 🚀 Let’s keep learning and growing 💪 #Linux #DevOps #ShellScripting #Day9 #LearningInPublic #ITSkills #CareerGrowth
To view or add a comment, sign in
-
💻 Exploring Shell Scripting: Small Commands, Big Impact Another step forward in my DevOps journey 🚀 Shell scripting is more than just writing commands — it’s about: ✔️ Automating repetitive tasks ✔️ Improving efficiency ✔️ Building scalable workflows 🔑 Key areas I worked on: • Bash scripting & execution • Variables and arguments • Control structures (if, for, while) • Automating daily tasks 💡 Why it matters? Because automation is the backbone of DevOps — saving time, reducing errors, and ensuring consistency. “The best way to predict the future is to automate it.” #ShellScripting #DevOps #Automation #Linux #ContinuousLearn
To view or add a comment, sign in
-
-
Day 19 of learning and practicing DevOps 🔁 Today all about building actual automation scripts Worked on: • Log rotation script to compress and clean old logs • Backup script to create timestamped archives • Scheduling jobs using crontab • Combining everything into a maintenance script Important part: Understanding why log rotation and backups matter — without them, logs can fill up disk space and break systems. learning today --> automation + scheduling Instead of manually managing logs and backups, scripts + cron can handle everything in the background. This one is actually used in production environments. Here are my notes: https://lnkd.in/gwQUKK8b 📍 #DevOps #Linux #ShellScripting #Automation #Crontab #LearningInPublic #90DaysOfDevOps #TrainWithShubham
To view or add a comment, sign in
-
Manual deployments taught me the most valuable lesson about automation. As a beginner, I got assigned what seemed like a simple task: deploy our app to the Linux server. No big deal, right? Wrong. I found myself doing this over and over for every single project. Creating directories, setting up services, configuring nginx... rinse and repeat. Hours of manual work. Countless errors. The same tedious steps every time. After probably my 3rd deployment disaster, something clicked. Instead of accepting this pain, I decided to build a script that would handle the entire process. Now our DevOps team just runs the script, fills in a few prompts, and boom – deployment complete. What used to take hours and generate tons of errors now takes 10 minutes with minimal mistakes. The real lesson? Sometimes the most frustrating tasks are actually showing you exactly what needs to be automated. That boring, repetitive work you're avoiding – what if it's actually your next breakthrough waiting to happen? #DevOps #Automation #Linux #Deployment #TechTips #SoftwareDevelopment #LearningInTech #Scripts
To view or add a comment, sign in
-
Day 6/100 – Automating Tasks with Cron in Linux Today’s task challenged me to set up and test scheduled automation using cron across multiple servers. The core concept was to validate that tasks can run automatically at defined intervals without manual intervention. To simulate real-world DevOps practices, I installed and configured the cron service ('cronie') on multiple app servers, ensured the service was running and enabled for persistence and created a scheduled task for the root user to run every 5 minutes The cron job: */5 * * * * echo hello > /tmp/cron_text This task taught me how cron is used in production environments; from automating backups and log cleanups to running critical scripts across distributed systems and a core DevOps principle resonated with me, "Automate repetitive tasks reliably and test before scaling." Looking forward to building more automation into real-world workflows. #DevOps #Linux #CloudEngineering #Automation #100DaysOfDevOps #LearningInPublic
To view or add a comment, sign in
-
Scalability in CI/CD: Understanding the Jenkins Master-Agent Architecture 🏗️ If you want to handle enterprise-level workloads, you can't run everything on a single server. Understanding the Master-Agent (formerly Master-Slave) architecture is key to efficient DevOps. This diagram breaks down the internal mechanics: The Master Node: The "Brain." It handles the UI, manages the job queue, stores configurations, and orchestrates the entire workflow. The Build Agents: The "Muscles." These are separate nodes (or containers) that actually execute the build tasks. This distribution prevents the Master from being overwhelmed. The API Layer: The bridge that allows external tools like Git, SonarQube, and Slack to communicate with the Jenkins core. By offloading builds to specific agents, we can run parallel jobs across different environments (Windows, Linux, Docker) simultaneously. That’s how you achieve true speed at scale. #DevOps #Jenkins #SystemArchitecture #CloudComputing #Automation #Scalability
To view or add a comment, sign in
-
-
Over the past few days, I’ve moved beyond basic Linux commands and started building practical, system-level automation. Here’s a snapshot of what I’ve been working on: • Designed log analysis scripts to parse real .log files and extract meaningful insights • Implemented severity classification (OK / WARNING / CRITICAL) based on thresholds • Learned to use exit codes as machine-readable signals — a core concept in CI/CD pipelines • Built structured reporting systems with timestamps and summarized outputs • Developed multi-stage scripts simulating real-world pipeline flows • Transitioned from static scripts to dynamic ones using arguments ($1, $@) • Implemented multi-service monitoring using system-level tools like systemctl • Gained clarity on how Linux manages services via systemd and how to interact with them programmatically What stands out the most is the shift in thinking: From writing commands → to designing systems that can analyze, decide, and signal outcomes automatically This is no longer just scripting — it’s the foundation of real DevOps workflows. #Linux #DevOps #Automation #SystemAdministration #LearningInPublic
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development