Beautiful Plants For Your Interior
Everyone loves the idea of a “one-and-done” script. You spend a weekend writing a Python loop to sync directories or a bash script to deploy a stack, run it once, see the green checkmarks, and tell yourself: “It’s automated now.”
This is where most people stop, and it’s exactly why their systems crash at 3 AM on a Tuesday.
The Drift Reality
Automation isn’t a static state; it’s a fight against entropy. The moment you hit enter, your system begins to drift. A cloud provider updates an API endpoint from v2 to v3. A disk fills up with log files because you forgot logrotate. A network partition drops a packet, leaving your database in a partial state that your script isn’t designed to recover from.
If your automation doesn’t account for failure as a primary state, it’s not automation—it’s just a delayed manual task.
Stop Writing Scripts, Start Designing Loops
The shift happens when you stop thinking about “execution” and start thinking about “convergence.”
Instead of: ssh server 'do_thing',
You move to: current_state = check(); if current_state != target_state: reconcile()
The Execution Blueprint
To move from fragile scripts to resilient systems, apply these constraints:
- Idempotency by Default: Every action must be safe to run ten times in a row. If you’re adding a user, don’t just run
useradd; check if the user exists first or use a tool that handles this natively. - Observability over Logs: Stop grepping files. Use heartbeats and health checks. If a process dies, a log entry is useless unless something else sees it and acts on it. Implement a “dead man’s switch”—if the automation doesn’t signal success every X minutes, you get paged.
- Hard-coded Constraints: Replace “hope” with timeouts. A script that hangs indefinitely on a
curlcall is a zombie. Set--max-time 10and handle the exit code explicitly.
Automation is about reducing cognitive load, not ignoring the system. The real pro doesn’t build a machine they never have to touch; they build a machine that tells them exactly why it needs touching.
