Skip to main content

Posts

Featured

Blog 15 Leveling Up Shell: Idempotent Scripts, Deployments & Log Cleanup

Idempotency, Deployment & Log Cleanup in Shell Scripting 🖥️Idempotency, Deployment & Log Cleanup in Shell Scripting Welcome back to the journey 🚀 In blog 14 , we learned about functions and loops. Now in blog 15 , we step into real-world server automation concepts. 🔁 1️⃣ What is Idempotency? Idempotent = Same result no matter how many times you run it id ec2-user &>/dev/null || useradd ec2-user 🌐 2️⃣ Idempotency in HTTP Methods Method Idempotent? Why GET ✅ Only reads data PUT ✅ Updates same resource DELETE ✅ (mostly) Deleting again gives “not found” POST ❌ Creates new data each time 🚀 3️⃣ Deployment Steps (Real Server) rm -rf /app/* git clone repo-url /app cd /app && npm install systemctl restart myapp 📂 4️⃣ Log Management in Linux find /var/log/myapp -name "*.log" -mtime +14 -delete 📦 5️⃣ Archiving Old Logs mkdir -p /archi...

Latest Posts

Blog 14 From Basics to Pro: Functions, Logs & Loops in Shell Scripting

Blog 13 Boring to Pro: Making Shell Scripts Smarter with Functions, Colors & Logs”

Blog 12 Git & Shell Scripting Made Easy: Learn Version Control and Automation

Blog 11 DevOps & Backend Starter Guide From Linux Commands to CI/CD Automation

Proxy vs Reverse Proxy

Blog 10 Understanding DNS to Inodes: From Browsers to Backends

Blog 9 Getting Started with DevOps: What Every Beginner Should Know

blog 8 How to Run Your App Like a Background Service (Even After Reboot!)

blog 7 Understanding 3-Tier Architecture with Real-Life Examples

Blog 6: Linux Permissions, SSH & Service Management – DevSecOps Foundations