Posts by BashSnippets

@BashSnippets

BashSnippets

Building a free bash script library. One script at a time | https://bashsnippets...
North America bashsnippets.xyz Joined May 2026
2.9k Points53 Badges3 Connections5 Followers23 Following

Posts by BashSnippets

BashSnippets in Tutorials 5 min read
Level: Intermediate · Time: 7 min · Outcome: A mental model and three guards for unattended cron jobs There's a gap between a script that works when you run it and a script that survives running unattended for a year. The first only has to succeed o...
post-cover-22128
BashSnippets in Tutorials 4 min read
Three Lines of Bash Stand Between Your Cron Job and a Silent Outage Level: Intermediate · Time: 6 min · Outcome: A hardened, ShellCheck-clean cron wrapper generated for you Three separate incidents taught me the same lesson over about a year. A /1...
post-cover-21961
BashSnippets in Tutorials 4 min read
A /1 rsync took our staging box to a load average of 41 one afternoon, and it took me longer than I want to admit to work out why. The sync normally finished in about twenty seconds. That day the backup target's NFS mount went sluggish, the sync star...
post-cover-21166
BashSnippets in Tutorials 6 min read
I meant to delete the .cache files under a data directory. The server had been running for two months and the cache layer had grown to about 14GB. The application team told me it was safe to purge it — they'd rebuilt the cache logic and the old files...
post-cover-20867
BashSnippets in Tutorials 3 min read
A backup script of mine created a lock file on startup so two copies couldn't run at once — sensible. Then one night it hit an error partway through, set -e killed it on the spot, and it died without ever reaching the line that removes the lock. The ...
post-cover-20323
BashSnippets in Tutorials 6 min read
Every time I provision a new server — whether it's a $5 DigitalOcean droplet for a side project or a client's production box — there's a set of scripts I copy to /opt/scripts before I do anything else. Not after the app is deployed. Not after the fi...
post-cover-20082
BashSnippets in Tutorials 6 min read
Nobody announces small features. You ship them, they're in there, and the people who find them either notice or they don't. I want to start documenting these because some of them are the kind of thing that makes a tool actually worth using day-to-day...
post-cover-20000
BashSnippets in Tutorials 8 min read
ShellCheck Error Codes Explained: How to Decode, Fix, and Prevent the Most Common Bash Warnings Level: Beginner to Intermediate Time: ~10 minutes What you'll leave with: A clear understanding of ShellCheck's error code system, how to fix the on...
post-cover-19016
BashSnippets in Tutorials 4 min read
Here's how it usually goes: You deploy something. Traffic is light. Server load sits at 15% and you move on to the next thing. Then traffic grows, or a cron job stacks on itself, or a memory leak slowly eats through your RAM over 72 hours. By the ti...
post-cover-18494
BashSnippets in Tutorials 6 min read
I Google "bash remove file extension" at least once a month. Every time I need ${filename%.txt} I have to look it up. I've written that exact syntax probably 40 times across different scripts. My brain refuses to memorize it. And every time I need i...
post-cover-18495
BashSnippets in Tutorials 2 min read
Every experienced Linux user has been there: you install something, or move directories around, and suddenly command not found appears for tools you know are installed. You check which, type, echo $PATH, and still waste 10-20 minutes hunting down th...
post-cover-17087
BashSnippets in Tutorials 1 min read
The Problem You're setting file permissions and you type chmod 754... or was it 744? You Google it. Again. Or you're starting a new bash script and you copy the header block from your last script because you can't remember the exact set -euo pipef...
post-cover-16991
BashSnippets in Tutorials 2 min read
The Problem You're deploying a script and need the right file permissions. You type chmod 754... or was it 744? You Google it. You find a Stack Overflow thread from 2011. You get it wrong anyway. chmod's octal notation is one of those things every...
post-cover-16987
BashSnippets in Tutorials 2 min read
Cron job tutorials have a problem. They teach you the five-field syntax, show you a couple of examples like 0 2 , and send you on your way. What they don't cover is everything that needs to go around the expression for the job to actually work rel...
post-cover-16899
chevron_left

Latest Jobs

View all jobs →