I share this story from time to time whenever this question comes up. I'm probably a broken record at this point but I've always thought it important to set expectations clearly for new devs by being open about my own failures; and after the recent reddit post it seems about time to braindump once again.<p>I deleted /etc on a live, user facing, production cluster once.<p>Wrote a script to determine OS, settings, a bunch of other bits, and then configure the node appropriately. I sanity checked it for BSD, ubuntu, debian, RHEL, all the machines I thought it would run on.<p>Turns out there was a Solaris cluster.<p>Long and the short; the software I was configuring installed differently on Solaris, my script did not properly audit/validate, and proceeded to, upon not finding the right subdirectories when performing a traversal, declare itself done while still sitting in /etc and nuke the entire dir.<p>The joking lesson I tell myself from this I summarize as a quote my sysadmin mentor told me: "Don't miss."<p>Less glibly, and more actionably,<p>- enumerate your edge cases and failure modes rigorously both from a "what do I expect" and a "what if" perspective. (kinda under this bucket, UNDERSTAND YOUR GODDAMN SPEC, AGGRESSIVELY; this is true both in ops and dev)<p>-Write your code with the EXPECTATION that bits will fail, and have it self audit.<p>-rm * is a big hammer. For all the press DD gets, rm * (and rf) should be used with care and proper precaution, ESPECIALLY if automated. Have extra "mental flags" to give extra care if you see rm *'s and such in your code.<p>-PHASED ROLLOUTS.<p>I'm sure there are more learnings, but those are what come to mind at a thought.<p>To answer the latter half of your question, the repercussion (and remedy) was my boss going to me: "whelp, you get to send out an outage email, and learn how to rebuild a cluster" (not before calling the other sysadmins into the room, having a brief moment of "let's point and laugh" and then sharing their own explosions, some of which made mine pale in comparison :) )