Accidentally Deleting Everything
feld.com
feld.com
Basically, you can mount individual bricks in /tmp and run a 'forcefully fix this split brain.'
I left this running to let things get happy overnight in a screen. The following morning every single file was gone.
I had left a tmpwatch on /tmp to remove all files in /tmp after a certain point in time. We had a backup, but it was a few days old. That was a fun weekend.
It is the worst feeling in the world, and one that I'll never make again... at least like that.
Sod off the lot of you and leave my files where you found them.
When I tried to set this up using BitTorrent Sync, iTunes kept removing the files BTS would copy. I had set it to read only so BTS would then copy the file over, and iTunes would add it a second time to the library. Then a third time. Then suddenly when I had 12 copies of everything and my half a terrabyte SSD was nearing capacity for no obvious reason, I finally figured out what the hell was going on and put a stop to it.
Appreciate the attempt at help though. :)
echo "Bad! Use `trash` instead."; return 1
and use trash-cli [1] instead, which moves the target files and folders to the Linux equivalent of the Recycle Bin. If I mess up, my files are one restore-trash command from being recovered. Every so often I trash-empty to free up space.Recent example - I wrote a bash script using many of the fancy parameters of lsof to map my work infrastructure's network. The code ran on my arch desktop, but as soon as it was run across the environment.. oh my god the stderr.
Eventually bit the bullet, logged onto the oldest centos4 machine and wrote the silly thing from there in sh. It ended up being significantly better than the bash version, too. :)
/tangent
A better example might've been rsync, where it's incredibly easy to wipe a directory if you forget a leading slash with the right flags.
I want to hear about the bug they deployed, the customer issue, dropping the database, etc. I want to hear about how they realized their mistake and what they do differently as a result now. Basically, "what did you learn from it?"
Mine:
I once dropped the article table for [major news organization] which handled [large number] of updates each day. It was something stupid like "delete from articles where id = ~" and when it took more than a second, I realized my issue.. damage done.
Now, I avoid running sql queries directly whenever possible in favor of migrations. But I test those migrations on smaller/test databases which are normally backups of production to have the same structure, etc. And I always do a select first to make sure I get the results I expect.. then change it into a delete or update.
I think it acknowledges a simple truth:
We all make mistakes. Some of them stunningly big and we think - even for a moment - "my boss is going to fire me!" And then once we calm down, we stop to think about what happened, how to fix it, and how to prevent it from ever happening again.
And if you claim to have never made one, you're either a) lying, b) oblivious or c) so green that you'll make those mistakes with me. The first two reasons don't fly with me.
Long story short, I cornered that director some time after the meeting, apologized profusely, and explained that I'm overly sensitive to mistakes in this position since I witnessed first-hand what happened when a predecessor of mine made a "simple" error, which resulted in a major patient-impacting event (which resulted in an FDA investigation). The upshot is that this director, from that point on, trusted me more than anyone else on the team (even though I was "highly insubordinate" in the previous meeting).
But of course you should also have backups, but on another system/offsite/offline.
Alternatively, run something like tarsnap once per hour.
Long live dropbox with rat-pack option.
Another benefit of using a standard inverter is that it is fairly lightweight so you can send it with the rest of the gear halfway around the globe and just source car batteries locally.
Many of the bigger rackmount UPSes have a big plug on the back to attach extra battery cabinets. I wouldn't get a big UPS without this feature. They'll let you hang whatever batteries you want off of the charger/inverter, as long as you get the voltage and charge rates right. (Obviously we are in warranty-voiding territory here.)
I have a couple of old Tripp-Lites, bought basically at scrap value because the internal batteries were dead, and they use Anderson SB175 forklift-charger connectors on the back. It works fine with just external batteries, giving you the advantage of being able to buy whatever SLAs happen to be cheap on the local market. (Though I'd definitely want to make sure all 4 were purchased at the same time since you're wiring them up together in a set.)
A user-replaceable battery that can be replaced in the way that an older Thinkpad battery can would be nice.
I'm looking at the options suggested [here](https://news.ycombinator.com/item?id=10831796) and [here](https://news.ycombinator.com/item?id=10831721), but I'm having a hard time finding APC battery availability in India.
I remember the time when a sysadmin gave two weeks notice and left just before the Christmas holidays, before getting new backup system fully working.
During the holidays, when almost everybody was out of town, one of the disks in our main server's RAID array failed. Then when the RAID controller tried to rebuild the array using the hot spare, a second disk failed. Then, just because the situation wasn't already horrible enough, the ancient proprietary controller (the one which knew how all the data was actually spread across all the disks) decided that this would be a great time to give up for good.
We ended up paying about $7K to DriveSavers, who managed to salvage nearly all the data from the remnants of the RAID array. And while we were interviewing sysadmins, we replaced the hardware and set up a real backup system. Then we built an offsite mirror of the backup system, and we configured paranoid monitoring for all our RAID controllers.
It's easy to get 100% uptime and no data loss for several years, if you're lucky. But if you build sloppy systems, sooner or later everything will go wrong, and when it does, the chaos can be impressive.
I felt like such an idiot. At least I haven't messed up an rsync command since!